---------------------------------------------
-- Export file for user IMSP               --
---------------------------------------------

spool create-all.log

prompt
prompt Creating table IMSP_AUDIT_ORDER
prompt ===============================
prompt
create table IMSP_AUDIT_ORDER
(
  ID             NUMBER(19) not null,
  OBJ_TYPE       VARCHAR2(128 CHAR),
  OBJ_NAME       VARCHAR2(128 CHAR),
  OBJ_CODE       VARCHAR2(128 CHAR),
  OBJ_IDS        VARCHAR2(512 CHAR),
  ACTION         VARCHAR2(18 CHAR),
  STATUS         NUMBER(2),
  CREATE_TIME    TIMESTAMP(6),
  UPDATE_TIME    TIMESTAMP(6),
  STATION_IDS    VARCHAR2(128 CHAR),
  OPERATOR       VARCHAR2(32 CHAR),
  AUDITOR        VARCHAR2(32 CHAR),
  AUDIT_COMMENTS VARCHAR2(1024 CHAR),
  PRIORITY       NUMBER(2)
)
;
alter table IMSP_AUDIT_ORDER
  add constraint PK_IMSP_AUDIT_ORDER primary key (ID);

prompt
prompt Creating table IMSP_CAST
prompt ========================
prompt
create table IMSP_CAST
(
  ID           NUMBER(19) not null,
  NAME         VARCHAR2(64 CHAR),
  CODE         VARCHAR2(64 CHAR),
  DISPLAY_NAME VARCHAR2(64 CHAR),
  SORT_NAME    VARCHAR2(64 CHAR),
  SEARCH_NAME  VARCHAR2(64 CHAR),
  FIRST_NAME   VARCHAR2(32 CHAR),
  LAST_NAME    VARCHAR2(32 CHAR),
  MIDDLE_NAME  VARCHAR2(32 CHAR),
  SEX          NUMBER(1),
  BIRTHDAY     VARCHAR2(16 CHAR),
  HOMETOWN     VARCHAR2(128 CHAR),
  EDUCATION    VARCHAR2(128 CHAR),
  HEIGHT       VARCHAR2(32 CHAR),
  WEIGHT       VARCHAR2(5 CHAR),
  BLOOD_GROUP  VARCHAR2(5 CHAR),
  MARRIAGE     NUMBER(1),
  FAVORITE     VARCHAR2(128 CHAR),
  WEB_PAGE     VARCHAR2(128 CHAR),
  DESCRIPTION  VARCHAR2(1024 CHAR),
  STATUS       NUMBER(2),
  CREATE_TIME  TIMESTAMP(6),
  UPDATE_TIME  TIMESTAMP(6),
  OPERATOR_ID  NUMBER(19),
  SOURCE       VARCHAR2(32 CHAR),
  OLD_ID       VARCHAR2(128 CHAR)
)
;
alter table IMSP_CAST
  add constraint PK_IMSP_CAST primary key (ID);
alter table IMSP_CAST
  add constraint INX_CAST_CODE unique (CODE);

prompt
prompt Creating table IMSP_CAST_ROLE
prompt =============================
prompt
create table IMSP_CAST_ROLE
(
  ID          NUMBER(19) not null,
  CODE        VARCHAR2(128 CHAR),
  ROLE_NAME   VARCHAR2(32 CHAR),
  STATUS      NUMBER(2),
  CAST_ID     NUMBER(19),
  UPDATE_TIME TIMESTAMP(6),
  OPERATOR_ID NUMBER(19),
  SOURCE      VARCHAR2(32 CHAR),
  OLD_ID      VARCHAR2(128 CHAR)
)
;
alter table IMSP_CAST_ROLE
  add constraint PK_IMSP_CAST_ROLE primary key (ID);
alter table IMSP_CAST_ROLE
  add constraint FK_ROLE_REF_CAST foreign key (CAST_ID)
  references IMSP_CAST (ID);

prompt
prompt Creating table IMSP_CATEGORY
prompt ============================
prompt
create table IMSP_CATEGORY
(
  ID            NUMBER(19) not null,
  NAME          VARCHAR2(128 CHAR),
  CODE          VARCHAR2(128 CHAR),
  PARENT_ID     NUMBER(19),
  SEQUENCE      NUMBER(10),
  STATUS        NUMBER(10),
  PATH          VARCHAR2(256 CHAR),
  TYPE          NUMBER(10),
  CREATE_TIME   TIMESTAMP(6),
  UPDATE_TIME   TIMESTAMP(6),
  OPERATOR_ID   NUMBER(19),
  SOURCE        VARCHAR2(32 CHAR),
  OLD_ID        VARCHAR2(128 CHAR),
  DESCRIPTION   VARCHAR2(256 CHAR),
  PUBLISH_DATE  DATE,
  CATEGORY_PATH VARCHAR2(1024 CHAR),
  EXTERNAL_ID   VARCHAR2(128 CHAR),
  SP_CODE       VARCHAR2(32 CHAR)
)
;
comment on table IMSP_CATEGORY
  is '节目分类表';
comment on column IMSP_CATEGORY.ID
  is '分类ID';
comment on column IMSP_CATEGORY.NAME
  is '分类名称';
comment on column IMSP_CATEGORY.CODE
  is '分类编码';
comment on column IMSP_CATEGORY.PARENT_ID
  is '父分类ID';
comment on column IMSP_CATEGORY.SEQUENCE
  is '顺序号';
comment on column IMSP_CATEGORY.STATUS
  is '分类状态：
0：失效状态；
1：生效状态；
-1：删除状态';
comment on column IMSP_CATEGORY.PATH
  is '定位字符串';
comment on column IMSP_CATEGORY.TYPE
  is '分类的类型：
1：普通分类 其他：业务分类';
comment on column IMSP_CATEGORY.CREATE_TIME
  is '创建时间';
comment on column IMSP_CATEGORY.UPDATE_TIME
  is '修改时间';
comment on column IMSP_CATEGORY.OPERATOR_ID
  is '操作员ID';
comment on column IMSP_CATEGORY.SOURCE
  is '来源';
comment on column IMSP_CATEGORY.DESCRIPTION
  is '描述';
comment on column IMSP_CATEGORY.PUBLISH_DATE
  is '发布时间';
alter table IMSP_CATEGORY
  add constraint PK_IMSP_CATEGORY primary key (ID);

prompt
prompt Creating table IMSP_CATEGORY_STATISTIC
prompt ======================================
prompt
create table IMSP_CATEGORY_STATISTIC
(
  ID              NUMBER(19) not null,
  NAME            VARCHAR2(128 CHAR),
  CODE            VARCHAR2(128 CHAR),
  PARENT_ID       NUMBER(19),
  SEQUENCE        NUMBER(19),
  ISLEAF          NUMBER(1),
  PROGRAM_NUMBER  NUMBER(19) default 0 not null,
  PROGRAM_LENGTH  NUMBER(19) default 0 not null,
  PROGRAM_SIZE    NUMBER(19) default 0 not null,
  PROGRAM_PERCENT NUMBER(5) default 0 not null
)
;
alter table IMSP_CATEGORY_STATISTIC
  add constraint PK_IMSP_CATEGORY_STATISTIC primary key (ID);

prompt
prompt Creating table IMSP_COLLECTION
prompt ==============================
prompt
create table IMSP_COLLECTION
(
  ID                  NUMBER(19) not null,
  NAME                VARCHAR2(64 CHAR),
  CODE                VARCHAR2(32 CHAR),
  STATUS              NUMBER(2),
  NOTIFY_URL          VARCHAR2(1024 CHAR),
  BUSI_NOTIFY_URL     VARCHAR2(1024 CHAR),
  CONTENT_REQUEST_URL VARCHAR2(1024 CHAR),
  SP_CODE             VARCHAR2(32 CHAR),
  VERSION             VARCHAR2(32 CHAR),
  REPORT_URL          VARCHAR2(128 CHAR)
)
;
comment on table IMSP_COLLECTION
  is '节目采集源信息表';
comment on column IMSP_COLLECTION.NAME
  is '采集源的名称';
comment on column IMSP_COLLECTION.CODE
  is '唯一编码';
comment on column IMSP_COLLECTION.STATUS
  is '可用状态：
-1:删除状态;
0:正常状态;
1:禁用状态';
comment on column IMSP_COLLECTION.NOTIFY_URL
  is '用于CMS通知采集源的接口地址';
comment on column IMSP_COLLECTION.CONTENT_REQUEST_URL
  is '用于CMS向采集源请求节目的接口地址';
alter table IMSP_COLLECTION
  add constraint PK_IMSP_COLLECTION primary key (ID);

prompt
prompt Creating table IMSP_COLLECT_BUSI_REQ
prompt ====================================
prompt
create table IMSP_COLLECT_BUSI_REQ
(
  ID               NUMBER(19) not null,
  CORRELATE_ID     VARCHAR2(64 CHAR),
  CSP_ID           VARCHAR2(64 CHAR),
  LSP_ID           VARCHAR2(64 CHAR),
  FILE_URL         VARCHAR2(1024 CHAR),
  STATUS           NUMBER(10),
  RECORD_TIME      TIMESTAMP(6),
  END_TIME         TIMESTAMP(6),
  ERROR_CODE       VARCHAR2(64 CHAR),
  FILE_PATH        VARCHAR2(1024 CHAR),
  REPEAT_FILE_PATH VARCHAR2(1024 CHAR),
  ERROR_EXCEPTION  VARCHAR2(2048 CHAR),
  OBJ_NAME         VARCHAR2(512 CHAR),
  OBJ_CLASS        VARCHAR2(512 CHAR),
  NOTIFY_STATUS    NUMBER(2) default 0,
  RETRY_COUNT      NUMBER(2) default 0
)
;
alter table IMSP_COLLECT_BUSI_REQ
  add constraint PK_IMSP_COLLECT_BUSI_REQ primary key (ID);

prompt
prompt Creating table IMSP_COLLECT_PREEDIT
prompt ===================================
prompt
create table IMSP_COLLECT_PREEDIT
(
  ID          NUMBER(19) not null,
  OBJ_TYPE    VARCHAR2(128 CHAR),
  OBJ_NAME    VARCHAR2(128 CHAR),
  OBJ_CODE    VARCHAR2(128 CHAR),
  ACTION      VARCHAR2(18 CHAR),
  OPERATOR    VARCHAR2(32 CHAR),
  CSP_ID      VARCHAR2(32 CHAR),
  STATUS      NUMBER(2),
  CREATE_TIME TIMESTAMP(6),
  UPDATE_TIME TIMESTAMP(6),
  OBJ_IDS     VARCHAR2(512 CHAR),
  CP_CODE     VARCHAR2(32 CHAR)
)
;
alter table IMSP_COLLECT_PREEDIT
  add constraint PK_IMSP_COLLECT_PREEDIT primary key (ID);

prompt
prompt Creating table IMSP_COLLECT_REQ
prompt ===============================
prompt
create table IMSP_COLLECT_REQ
(
  ID               NUMBER(19) not null,
  CORRELATE_ID     VARCHAR2(64 CHAR),
  CSP_ID           VARCHAR2(64 CHAR),
  LSP_ID           VARCHAR2(64 CHAR),
  FILE_URL         VARCHAR2(1024 CHAR),
  STATUS           NUMBER(10),
  RECORD_TIME      TIMESTAMP(6),
  END_TIME         TIMESTAMP(6),
  ERROR_CODE       VARCHAR2(64 CHAR),
  FILE_PATH        VARCHAR2(1024 CHAR),
  REPEAT_FILE_PATH VARCHAR2(1024 CHAR),
  ERROR_EXCEPTION  VARCHAR2(2048 CHAR),
  OBJ_NAME         VARCHAR2(512 CHAR),
  NOTIFY_STATUS    NUMBER(2) default 0,
  RETRY_COUNT      NUMBER(2) default 0,
  OBJ_TYPE         VARCHAR2(128 CHAR),
  OBJ_CODE         VARCHAR2(128 CHAR),
  PRIORITY         NUMBER(2),
  ACTION           VARCHAR2(10 CHAR)
)
;
alter table IMSP_COLLECT_REQ
  add constraint PK_IMSP_COLLECT_REQ primary key (ID);

prompt
prompt Creating table IMSP_COMMAND_CONTENT
prompt ===================================
prompt
create table IMSP_COMMAND_CONTENT
(
  ID               NUMBER(19) not null,
  STATION_NAME     VARCHAR2(128 CHAR),
  PREPARE_ALL      NUMBER(19),
  PREPARE_NOW      NUMBER(19),
  WAIT_ALL         NUMBER(19),
  WAIT_NOW         NUMBER(19),
  WAIT_CONTENT_ALL NUMBER(19),
  WAIT_CONTENT_NOW NUMBER(19),
  WAIT_UPDATE_ALL  NUMBER(19),
  WAIT_UPDATE_NOW  NUMBER(19),
  FAIL_ALL         NUMBER(19),
  FAIL_NOW         NUMBER(19),
  FAIL_CONTENT_ALL NUMBER(19),
  FAIL_CONTENT_NOW NUMBER(19),
  FAIL_UPDATE_ALL  NUMBER(19),
  FAIL_UPDATE_NOW  NUMBER(19),
  FAIL_DELETE_ALL  NUMBER(19),
  FAIL_DELETE_NOW  NUMBER(19)
)
;
alter table IMSP_COMMAND_CONTENT
  add constraint PK_IMSP_COMMAND_CONTENT primary key (ID);

prompt
prompt Creating table IMSP_COMMAND_ELEMENT
prompt ===================================
prompt
create table IMSP_COMMAND_ELEMENT
(
  ID            NUMBER(19) not null,
  COMMAND_ID    NUMBER(19),
  STATION_ID    NUMBER(19),
  ELEMENT_ID    NUMBER(19),
  ELEMENT_CLASS VARCHAR2(256 CHAR),
  ACTION        VARCHAR2(32 CHAR),
  OBJ_ID        NUMBER(19),
  CONTENT_ID    NUMBER(19)
)
;
comment on table IMSP_COMMAND_ELEMENT
  is '分发指令和对象的关系表';
comment on column IMSP_COMMAND_ELEMENT.STATION_ID
  is '对应的驻地ID';
comment on column IMSP_COMMAND_ELEMENT.ELEMENT_ID
  is '对象ID';
comment on column IMSP_COMMAND_ELEMENT.ELEMENT_CLASS
  is '对象类名';
comment on column IMSP_COMMAND_ELEMENT.ACTION
  is '分发操作：
REGIST：新增
UPDATE：更新
DELETE：删除';
alter table IMSP_COMMAND_ELEMENT
  add constraint PK_IMSP_COMMAND_ELEMENT primary key (ID);

prompt
prompt Creating table IMSP_COMMAND_POSITION
prompt ====================================
prompt
create table IMSP_COMMAND_POSITION
(
  ID            NUMBER(19) not null,
  TIME          TIMESTAMP(6),
  DISPATCH_FAIL NUMBER(19),
  STATION_NAME  VARCHAR2(128 CHAR)
)
;
alter table IMSP_COMMAND_POSITION
  add constraint PK_IMSP_COMMAND_POSITION primary key (ID);

prompt
prompt Creating table IMSP_COMMAND_SCHEDULE
prompt ====================================
prompt
create table IMSP_COMMAND_SCHEDULE
(
  ID               NUMBER(19) not null,
  TIME             TIMESTAMP(6),
  STATION_NAME     VARCHAR2(128 CHAR),
  DISPATCH_FAIL    NUMBER(19),
  DISPATCH_SUCCESS NUMBER(19)
)
;
alter table IMSP_COMMAND_SCHEDULE
  add constraint PK_IMSP_COMMAND_SCHEDULE primary key (ID);

prompt
prompt Creating table IMSP_CONTENT_BASE
prompt ================================
prompt
create table IMSP_CONTENT_BASE
(
  CONTENT_ID            NUMBER(19) not null,
  NAME                  VARCHAR2(128 CHAR),
  CODE                  VARCHAR2(128 CHAR),
  ORI_NAME              VARCHAR2(128 CHAR),
  TYPE                  NUMBER(4),
  GENRE                 VARCHAR2(128 CHAR),
  CP_CODE               VARCHAR2(128 CHAR),
  COPYRIGHT_TYPE        NUMBER(2),
  COPYRIGHT_VALID_TIME  TIMESTAMP(6),
  COPYRIGHT_EXPIRE_TIME TIMESTAMP(6),
  DEFAULT_PRICE_TYPE    NUMBER(2),
  DEFAULT_PRICE         NUMBER(19),
  VALID_TIME            TIMESTAMP(6),
  EXPIRE_TIME           TIMESTAMP(6),
  KEYWORD               VARCHAR2(128 CHAR),
  TAGS                  VARCHAR2(128 CHAR),
  SORT_NAME             VARCHAR2(128 CHAR),
  SRARCH_NAME           VARCHAR2(128 CHAR),
  NEW_DAY               NUMBER(3),
  LEFT_DAY              NUMBER(3),
  STATUS                NUMBER(2),
  ENABLE_STATUS         NUMBER(2),
  FILE_STATUS           NUMBER(2),
  LENGTH                NUMBER(19),
  SOURCE                VARCHAR2(32 CHAR),
  CREATE_TIME           TIMESTAMP(6),
  UPDATE_TIME           TIMESTAMP(6),
  OPERATOR_ID           NUMBER(19),
  OLD_ID                VARCHAR2(128 CHAR),
  CONTENT_TYPE          VARCHAR2(128 CHAR),
  ORDER_NUMBER          VARCHAR2(20 CHAR),
  ACTIVE_STATUS         NUMBER(2) default 0,
  AUDIT_STATUS          NUMBER(2) default 0,
  EXTERNAL_ID           VARCHAR2(128 CHAR),
  IS_PRICE_BAND         NUMBER(1),
  VOD_ARRANGE           NUMBER(2),
  CATEGORY              VARCHAR2(64 CHAR),
  R_MEDIA_CODE          VARCHAR2(256 CHAR),
  HD                    NUMBER(2) DEFAULT 0,
  CONTENT_PROVIDER      VARCHAR2(50),
  COPYRIGHT             VARCHAR2(128),
  OPINCHARGE            VARCHAR2(50),
  KPEOPLE               VARCHAR2 (150),           
  DIRECTOR              VARCHAR2 (50),           
  GUEST                 VARCHAR2 (50),           
  REPORTER              VARCHAR2 (50),           
  VSPCODE               VARCHAR2 (32),                        
  SCRIPT_WRITER         VARCHAR2 (50),           
  COMPERE               VARCHAR2 (50)           
)
;
comment on table IMSP_CONTENT_BASE
  is '节目表';
comment on column IMSP_CONTENT_BASE.NAME
  is '节目名称';
comment on column IMSP_CONTENT_BASE.CODE
  is '节目编码';
comment on column IMSP_CONTENT_BASE.ORI_NAME
  is '节目原名';
comment on column IMSP_CONTENT_BASE.TYPE
  is '节目类型';
comment on column IMSP_CONTENT_BASE.GENRE
  is '节目类别';
comment on column IMSP_CONTENT_BASE.CP_CODE
  is '提供商编码';
comment on column IMSP_CONTENT_BASE.COPYRIGHT_TYPE
  is '节目版权类型：
0：无版权
1：有版权';
comment on column IMSP_CONTENT_BASE.COPYRIGHT_VALID_TIME
  is '版权生效时间';
comment on column IMSP_CONTENT_BASE.COPYRIGHT_EXPIRE_TIME
  is '版权失效时间';
comment on column IMSP_CONTENT_BASE.DEFAULT_PRICE_TYPE
  is '节目默认的资费类型：
0：无默认资费
1：按次计费
2:包';
comment on column IMSP_CONTENT_BASE.DEFAULT_PRICE
  is '节目的默认资费。当节目的默认资费类型为按次计费时，该字段表示节目按次计费的默认资费，单位：分';
comment on column IMSP_CONTENT_BASE.VALID_TIME
  is '生效时间';
comment on column IMSP_CONTENT_BASE.EXPIRE_TIME
  is '失效时间';
comment on column IMSP_CONTENT_BASE.KEYWORD
  is '关键字';
comment on column IMSP_CONTENT_BASE.TAGS
  is '关联标签';
comment on column IMSP_CONTENT_BASE.SORT_NAME
  is '索引名称';
comment on column IMSP_CONTENT_BASE.SRARCH_NAME
  is '搜索名称';
comment on column IMSP_CONTENT_BASE.NEW_DAY
  is '新到天数';
comment on column IMSP_CONTENT_BASE.LEFT_DAY
  is '剩余天数';
comment on column IMSP_CONTENT_BASE.STATUS
  is '节目的状态：
0：采集中；
1：待处理；
2：正常；
-1：已删除';
comment on column IMSP_CONTENT_BASE.ENABLE_STATUS
  is '节目的生效状态
0：失效
1：生效';
comment on column IMSP_CONTENT_BASE.FILE_STATUS
  is '2：传输中
3：传输失败
4：传输完成
5：文件已删除';
comment on column IMSP_CONTENT_BASE.LENGTH
  is '播放时长(秒)';
comment on column IMSP_CONTENT_BASE.SOURCE
  is '节目来源';
comment on column IMSP_CONTENT_BASE.CREATE_TIME
  is '入库时间';
comment on column IMSP_CONTENT_BASE.UPDATE_TIME
  is '修改时间';
comment on column IMSP_CONTENT_BASE.OPERATOR_ID
  is '操作员ID';
comment on column IMSP_CONTENT_BASE.CONTENT_TYPE
  is '节目内容子类型（对应TYPE）';
comment on column IMSP_CONTENT_BASE.ORDER_NUMBER
  is '订购编号';
comment on column IMSP_CONTENT_BASE.ACTIVE_STATUS
  is '厂商节目生效状态：0：失效
1：生效';
comment on column IMSP_CONTENT_BASE.AUDIT_STATUS
  is '审核状态:0：待审核
1：待审核 2： 审核通过 3：审核不通过';
comment on column IMSP_CONTENT_BASE.EXTERNAL_ID
  is '外部编码';
comment on column IMSP_CONTENT_BASE.IS_PRICE_BAND
  is '节目是否绑定资费。默认1：可绑定，0：强制不绑定。';
alter table IMSP_CONTENT_BASE
  add constraint PK_IMSP_CONTENT_BASE primary key (CONTENT_ID);
create unique index INX_CONTENT_BASE_CODE on IMSP_CONTENT_BASE (CODE);

prompt
prompt Creating table IMSP_CONTENT_CHANNEL
prompt ===================================
prompt
create table IMSP_CONTENT_CHANNEL
(
  CONTENT_ID          NUMBER(19) not null,
  CHANNEL_CATEGORY    NUMBER(10),
  VIEW_POINT          VARCHAR2(256 CHAR),
  CHANNEL_NUMBER      NUMBER(6),
  CALL_SIGN           VARCHAR2(20 CHAR),
  TIME_SHIFT          NUMBER(1),
  STORAGE_DURATION    NUMBER(9),
  TIME_SHIFT_DURATION NUMBER(19),
  COUNTRY             VARCHAR2(10 CHAR),
  STATE               VARCHAR2(10 CHAR),
  CITY                VARCHAR2(10 CHAR),
  ZIP_CODE            VARCHAR2(10 CHAR),
  LANGUAGE            VARCHAR2(64 CHAR),
  START_TIME          VARCHAR2(4 CHAR),
  END_TIME            VARCHAR2(4 CHAR),
  VIDEO_TYPE          VARCHAR2(10 CHAR),
  AUDIO_TYPE          VARCHAR2(10 CHAR),
  STREAM_TYPE         NUMBER(1),
  BILINGUAL           NUMBER(1),
  BITRATE_TYPE        NUMBER(1),
  MULTICAST_IP        VARCHAR2(64 CHAR),
  MULTICAST_PORT      NUMBER(5),
  DESCRIPTION         VARCHAR2(1024 CHAR),
  PHY_OLD_ID          VARCHAR2(128 CHAR),
  PUBLISH_DATE        DATE,
  URL                 VARCHAR2(128 CHAR)
)
;
comment on table IMSP_CONTENT_CHANNEL
  is '直播频道/聚场表';
comment on column IMSP_CONTENT_CHANNEL.CHANNEL_CATEGORY
  is '所属分类';
comment on column IMSP_CONTENT_CHANNEL.VIEW_POINT
  is '看点';
comment on column IMSP_CONTENT_CHANNEL.CHANNEL_NUMBER
  is '频道号';
comment on column IMSP_CONTENT_CHANNEL.CALL_SIGN
  is '台标名称';
comment on column IMSP_CONTENT_CHANNEL.TIME_SHIFT
  is '时移标志：0：不支持时移
1：支持时移';
comment on column IMSP_CONTENT_CHANNEL.STORAGE_DURATION
  is '存储时长，最大存储时长，单位：小时';
comment on column IMSP_CONTENT_CHANNEL.TIME_SHIFT_DURATION
  is '当频道支持时移时，默认的时移时长，单位：分钟';
comment on column IMSP_CONTENT_CHANNEL.COUNTRY
  is '所属国家';
comment on column IMSP_CONTENT_CHANNEL.STATE
  is '所属省/州';
comment on column IMSP_CONTENT_CHANNEL.CITY
  is '所属市';
comment on column IMSP_CONTENT_CHANNEL.ZIP_CODE
  is '邮政编码';
comment on column IMSP_CONTENT_CHANNEL.LANGUAGE
  is '语言';
comment on column IMSP_CONTENT_CHANNEL.START_TIME
  is '播放开始时间';
comment on column IMSP_CONTENT_CHANNEL.END_TIME
  is '播放结束时间';
comment on column IMSP_CONTENT_CHANNEL.VIDEO_TYPE
  is '视频参数';
comment on column IMSP_CONTENT_CHANNEL.AUDIO_TYPE
  is '音频参数';
comment on column IMSP_CONTENT_CHANNEL.STREAM_TYPE
  is '码流标志';
comment on column IMSP_CONTENT_CHANNEL.BILINGUAL
  is '双语标记';
comment on column IMSP_CONTENT_CHANNEL.BITRATE_TYPE
  is '码流';
comment on column IMSP_CONTENT_CHANNEL.MULTICAST_IP
  is '组播IP';
comment on column IMSP_CONTENT_CHANNEL.MULTICAST_PORT
  is '组播端口';
comment on column IMSP_CONTENT_CHANNEL.DESCRIPTION
  is '描述信息';
comment on column IMSP_CONTENT_CHANNEL.PHY_OLD_ID
  is '直播频道的PhysicalChannel原有标识';
comment on column IMSP_CONTENT_CHANNEL.PUBLISH_DATE
  is '发布时间';
comment on column IMSP_CONTENT_CHANNEL.URL
  is 'web channel url';
alter table IMSP_CONTENT_CHANNEL
  add constraint PK_IMSP_CONTENT_CHANNEL primary key (CONTENT_ID);
alter table IMSP_CONTENT_CHANNEL
  add constraint FK_CHANNEL_REF_CONTENT foreign key (CONTENT_ID)
  references IMSP_CONTENT_BASE (CONTENT_ID);

prompt
prompt Creating table IMSP_CONTENT_GENRE
prompt =================================
prompt
create table IMSP_CONTENT_GENRE
(
  ID              NUMBER(19) not null,
  NAME            VARCHAR2(16 CHAR),
  CONTENT_TYPE_ID NUMBER(19) not null
)
;
alter table IMSP_CONTENT_GENRE
  add constraint PK_IMSP_CONTENT_GENRE primary key (ID);

prompt
prompt Creating table IMSP_CONTENT_GROUP
prompt =================================
prompt
create table IMSP_CONTENT_GROUP
(
  ID             NUMBER(19) not null,
  NAME           VARCHAR2(128 CHAR),
  CODE           VARCHAR2(128 CHAR),
  STATUS         NUMBER(2),
  DESCRIPTION    VARCHAR2(1024 CHAR),
  INSERT_TIME    DATE,
  UPDATE_TIME    DATE,
  OPERATOR_ID    NUMBER(19),
  SOURCE         VARCHAR2(32 CHAR),
  CONTENT_COUNT  NUMBER(19) default 0,
  CONTENT_LENGTH NUMBER(19) default 0
)
;
comment on table IMSP_CONTENT_GROUP
  is '节目分组信息表';
comment on column IMSP_CONTENT_GROUP.STATUS
  is '节目分组的状态：
0：失效
1：生效
-1：删除';
alter table IMSP_CONTENT_GROUP
  add constraint PK_IMSP_CONTENT_GROUP primary key (ID);

prompt
prompt Creating table IMSP_CONTENT_REGION
prompt ==================================
prompt
create table IMSP_CONTENT_REGION
(
  ID              NUMBER(19) not null,
  NAME            VARCHAR2(16 CHAR),
  CONTENT_TYPE_ID NUMBER(19) not null
)
;
alter table IMSP_CONTENT_REGION
  add constraint PK_IMSP_CONTENT_REGION primary key (ID);

prompt
prompt Creating table IMSP_CONTENT_SCHEDULE
prompt ====================================
prompt
create table IMSP_CONTENT_SCHEDULE
(
  ID             NUMBER(19) not null,
  CONTENT_ID     NUMBER(19),
  CODE           VARCHAR2(128 CHAR),
  NAME           VARCHAR2(128 CHAR),
  OBJ_TYPE       NUMBER(1),
  OBJ_CODE       VARCHAR2(128 CHAR),
  START_DATE     TIMESTAMP(6),
  START_TIME     TIMESTAMP(6),
  END_TIME       TIMESTAMP(6),
  DURATION_TIME  VARCHAR2(6 CHAR),
  KEYWORDS       VARCHAR2(128 CHAR),
  TAGS           VARCHAR2(128 CHAR),
  DESCRIPTION    VARCHAR2(1024 CHAR),
  STATUS         NUMBER(1),
  GENRE          VARCHAR2(128 CHAR),
  CHANNEL_CODE   VARCHAR2(128 CHAR),
  SOURCE         VARCHAR2(32 CHAR),
  UPDATE_TIME    TIMESTAMP(6),
  OPERATOR_ID    NUMBER(19),
  CHANNEL_EXT_ID VARCHAR2(128 CHAR),
  SEARCH_NAME    VARCHAR2(128 CHAR),
  SOURCE_TYPE    NUMBER(10)
)
;
comment on table IMSP_CONTENT_SCHEDULE
  is '节目单信息表';
comment on column IMSP_CONTENT_SCHEDULE.CONTENT_ID
  is '频道ID';
comment on column IMSP_CONTENT_SCHEDULE.CODE
  is '节目单编码';
comment on column IMSP_CONTENT_SCHEDULE.NAME
  is '节目单名称';
comment on column IMSP_CONTENT_SCHEDULE.OBJ_TYPE
  is '节目单关联的对象类型
1：LiveTV Program(直播频道用)
2：VOD Program(虚拟频道用)';
comment on column IMSP_CONTENT_SCHEDULE.OBJ_CODE
  is '节目单关联的对象编码
ObjectType为1时，此项忽略
ObjectType为2时，填Program Code(关联已有VOD)
ObjectType为3时，填Channel Code(关联已有LiveChannel)';
comment on column IMSP_CONTENT_SCHEDULE.START_DATE
  is '节目单日期';
comment on column IMSP_CONTENT_SCHEDULE.START_TIME
  is '开始时间';
comment on column IMSP_CONTENT_SCHEDULE.END_TIME
  is '结束时间';
comment on column IMSP_CONTENT_SCHEDULE.DURATION_TIME
  is '节目单播放时长，格式：HHMISS';
comment on column IMSP_CONTENT_SCHEDULE.KEYWORDS
  is '关键字';
comment on column IMSP_CONTENT_SCHEDULE.TAGS
  is '关联标签';
comment on column IMSP_CONTENT_SCHEDULE.DESCRIPTION
  is '描述信息';
comment on column IMSP_CONTENT_SCHEDULE.STATUS
  is '状态:0：失效状态
1：生效状态
-1：删除状态';
comment on column IMSP_CONTENT_SCHEDULE.GENRE
  is '类别';
comment on column IMSP_CONTENT_SCHEDULE.CHANNEL_CODE
  is '频道编码';
comment on column IMSP_CONTENT_SCHEDULE.SOURCE
  is '来源';
comment on column IMSP_CONTENT_SCHEDULE.UPDATE_TIME
  is '修改时间';
comment on column IMSP_CONTENT_SCHEDULE.OPERATOR_ID
  is '操作员ID';
comment on column IMSP_CONTENT_SCHEDULE.SEARCH_NAME
  is '查询名称';
comment on column IMSP_CONTENT_SCHEDULE.SOURCE_TYPE
  is '来源类型';
alter table IMSP_CONTENT_SCHEDULE
  add constraint PK_IMSP_CONTENT_SCHEDULE primary key (ID);
alter table IMSP_CONTENT_SCHEDULE
  add constraint FK_SCHEDULE_REF_CHANNEL foreign key (CONTENT_ID)
  references IMSP_CONTENT_CHANNEL (CONTENT_ID);

prompt
prompt Creating table IMSP_CONTENT_SERIES
prompt ==================================
prompt
create table IMSP_CONTENT_SERIES
(
  CONTENT_ID     NUMBER(19) not null,
  REGION         VARCHAR2(128 CHAR),
  DESCIRPTION    VARCHAR2(1024 CHAR),
  VIEW_POINT     VARCHAR2(256 CHAR),
  COMPANY        VARCHAR2(128 CHAR),
  ISSUE_YEAR     NUMBER(4),
  ORIGIN_DATE    TIMESTAMP(6),
  LANGUAGE       VARCHAR2(32 CHAR),
  COMMENTS       VARCHAR2(512 CHAR),
  STAR_LEVEL     NUMBER(2),
  RATING         VARCHAR2(64 CHAR),
  ACTOR_DISPLAY  VARCHAR2(256 CHAR),
  WRITER_DISPLAY VARCHAR2(256 CHAR),
  AWARDS         VARCHAR2(64 CHAR),
  EPISODE_NUMBER NUMBER(6),
  ORDER_NUMBER   VARCHAR2(10 CHAR),
  RESERVE1       VARCHAR2(256 CHAR),
  RESERVE2       VARCHAR2(256 CHAR),
  RESERVE3       VARCHAR2(256 CHAR),
  RESERVE4       VARCHAR2(256 CHAR),
  RESERVE5       VARCHAR2(256 CHAR),
  SERIES_PACKAGE VARCHAR2(1024 CHAR)
)
;
comment on table IMSP_CONTENT_SERIES
  is '连续剧表';
comment on column IMSP_CONTENT_SERIES.REGION
  is '发行地区';
comment on column IMSP_CONTENT_SERIES.DESCIRPTION
  is '描述信息';
comment on column IMSP_CONTENT_SERIES.VIEW_POINT
  is '看点';
comment on column IMSP_CONTENT_SERIES.COMPANY
  is '出品公司';
comment on column IMSP_CONTENT_SERIES.ISSUE_YEAR
  is '发行年份';
comment on column IMSP_CONTENT_SERIES.ORIGIN_DATE
  is '首播日期';
comment on column IMSP_CONTENT_SERIES.LANGUAGE
  is '对白语言';
comment on column IMSP_CONTENT_SERIES.COMMENTS
  is '备注';
comment on column IMSP_CONTENT_SERIES.STAR_LEVEL
  is '推荐星级';
comment on column IMSP_CONTENT_SERIES.RATING
  is '限制级别';
comment on column IMSP_CONTENT_SERIES.ACTOR_DISPLAY
  is '连续剧的演员表，多个演员之间采用空格分开';
comment on column IMSP_CONTENT_SERIES.WRITER_DISPLAY
  is '连续导演列表，多个导演之间采用空格分开';
comment on column IMSP_CONTENT_SERIES.AWARDS
  is '所获奖项';
comment on column IMSP_CONTENT_SERIES.EPISODE_NUMBER
  is '剧集数';
comment on column IMSP_CONTENT_SERIES.ORDER_NUMBER
  is '订购编号';
comment on column IMSP_CONTENT_SERIES.RESERVE1
  is '保留字段1';
comment on column IMSP_CONTENT_SERIES.RESERVE2
  is '保留字段2';
comment on column IMSP_CONTENT_SERIES.RESERVE3
  is '保留字段3';
comment on column IMSP_CONTENT_SERIES.RESERVE4
  is '保留字段4';
comment on column IMSP_CONTENT_SERIES.RESERVE5
  is '保留字段5';
alter table IMSP_CONTENT_SERIES
  add constraint PK_IMSP_CONTENT_SERIES primary key (CONTENT_ID);
alter table IMSP_CONTENT_SERIES
  add constraint IMSP_SERIAL_REF_CONTENT foreign key (CONTENT_ID)
  references IMSP_CONTENT_BASE (CONTENT_ID);

prompt
prompt Creating table IMSP_CONTENT_TAG
prompt ===============================
prompt
create table IMSP_CONTENT_TAG
(
  ID              NUMBER(19) not null,
  NAME            VARCHAR2(16 CHAR),
  CONTENT_TYPE_ID NUMBER(19) not null
)
;
alter table IMSP_CONTENT_TAG
  add constraint PK_IMSP_CONTENT_TAG primary key (ID);

prompt
prompt Creating table IMSP_CONTENT_TYPE
prompt ================================
prompt
create table IMSP_CONTENT_TYPE
(
  ID   NUMBER(19) not null,
  NAME VARCHAR2(16 CHAR)
)
;
alter table IMSP_CONTENT_TYPE
  add constraint PK_IMSP_CONTENT_TYPE primary key (ID);

prompt
prompt Creating table IMSP_CONTENT_VOD
prompt ===============================
prompt
create table IMSP_CONTENT_VOD
(
  CONTENT_ID     NUMBER(19) not null,
  REGION         VARCHAR2(128 CHAR),
  DESCIRPTION    VARCHAR2(1024 CHAR),
  VIEW_POINT     VARCHAR2(256 CHAR),
  COMPANY        VARCHAR2(128 CHAR),
  ISSUE_YEAR     NUMBER(4),
  ORIGIN_DATE    TIMESTAMP(6),
  LANGUAGE       VARCHAR2(32 CHAR),
  COMMENTS       VARCHAR2(512 CHAR),
  STAR_LEVEL     NUMBER(2),
  RATING         VARCHAR2(64 CHAR),
  ACTOR_DISPLAY  VARCHAR2(256 CHAR),
  WRITER_DISPLAY VARCHAR2(256 CHAR),
  SPLITE_INFO    VARCHAR2(1024 CHAR),
  AWARDS         VARCHAR2(64 CHAR),
  RESERVE1       VARCHAR2(256 CHAR),
  RESERVE2       VARCHAR2(256 CHAR),
  RESERVE3       VARCHAR2(256 CHAR),
  RESERVE4       VARCHAR2(256 CHAR),
  RESERVE5       VARCHAR2(256 CHAR),
  STORAGE_TYPE   NUMBER(2)
)
;
comment on table IMSP_CONTENT_VOD
  is 'VOD表，包括电影、剧集等类型的节目信息';
comment on column IMSP_CONTENT_VOD.REGION
  is '发行地区';
comment on column IMSP_CONTENT_VOD.DESCIRPTION
  is '描述信息';
comment on column IMSP_CONTENT_VOD.VIEW_POINT
  is '看点';
comment on column IMSP_CONTENT_VOD.COMPANY
  is '出品公司';
comment on column IMSP_CONTENT_VOD.ISSUE_YEAR
  is '发行年份';
comment on column IMSP_CONTENT_VOD.ORIGIN_DATE
  is '首播日期';
comment on column IMSP_CONTENT_VOD.LANGUAGE
  is '对白语言';
comment on column IMSP_CONTENT_VOD.COMMENTS
  is '备注';
comment on column IMSP_CONTENT_VOD.STAR_LEVEL
  is '推荐星级';
comment on column IMSP_CONTENT_VOD.RATING
  is '限制级别';
comment on column IMSP_CONTENT_VOD.ACTOR_DISPLAY
  is '连续剧的演员表，多个演员之间采用空格分开';
comment on column IMSP_CONTENT_VOD.WRITER_DISPLAY
  is '连续剧的导演列表，多个导演之间采用空格分开';
comment on column IMSP_CONTENT_VOD.SPLITE_INFO
  is '拆条信息';
comment on column IMSP_CONTENT_VOD.AWARDS
  is '所获奖项';
comment on column IMSP_CONTENT_VOD.RESERVE1
  is '保留字段1';
comment on column IMSP_CONTENT_VOD.RESERVE2
  is '保留字段2';
comment on column IMSP_CONTENT_VOD.RESERVE3
  is '保留字段3';
comment on column IMSP_CONTENT_VOD.RESERVE4
  is '保留字段4';
comment on column IMSP_CONTENT_VOD.RESERVE5
  is '保留字段5';
comment on column IMSP_CONTENT_VOD.STORAGE_TYPE
  is '存储分发策略';
alter table IMSP_CONTENT_VOD
  add constraint PK_IMSP_CONTENT_VOD primary key (CONTENT_ID);
alter table IMSP_CONTENT_VOD
  add constraint FK_VOD_REF_CONTENT foreign key (CONTENT_ID)
  references IMSP_CONTENT_BASE (CONTENT_ID);

prompt
prompt Creating table IMSP_DICTIONARY
prompt ==============================
prompt
create table IMSP_DICTIONARY
(
  KEY   VARCHAR2(128 CHAR) not null,
  VALUE VARCHAR2(256 CHAR)
)
;
alter table IMSP_DICTIONARY
  add constraint PK_IMSP_DICTIONARY primary key (KEY);

prompt
prompt Creating table IMSP_DISPATCH_BUSI_CMD
prompt =====================================
prompt
create table IMSP_DISPATCH_BUSI_CMD
(
  ID           NUMBER(19) not null,
  ORDER_ID     NUMBER(19),
  STATION_ID   NUMBER(19),
  OBJ_CLASS    VARCHAR2(128 CHAR),
  OBJ_NAME     VARCHAR2(128 CHAR),
  OBJ_ACTION   VARCHAR2(510 CHAR),
  OBJ_IDS      VARCHAR2(128 CHAR),
  PRIORITY     NUMBER(10),
  TYPE         NUMBER(10),
  TASK_LEVEL   NUMBER(10),
  STATUS       NUMBER(10),
  INSERT_TIME  TIMESTAMP(6),
  BEGIN_TIME   TIMESTAMP(6),
  END_TIME     TIMESTAMP(6),
  UPDATE_TIME  TIMESTAMP(6),
  OPERATOR_ID  NUMBER(19),
  RETRY_COUNT  NUMBER(10),
  FILE_URL     VARCHAR2(512 CHAR),
  RESPONSE_URL VARCHAR2(512 CHAR),
  ERROR_DESC   VARCHAR2(1024 CHAR)
)
;
alter table IMSP_DISPATCH_BUSI_CMD
  add constraint PK_IMSP_DISPATCH_BUSI_CMD primary key (ID);
create index INX_DISPATCH_BUSI_CMD_STATUS on IMSP_DISPATCH_BUSI_CMD (STATION_ID, END_TIME, STATUS);

prompt
prompt Creating table IMSP_DISPATCH_BUSI_ORDER
prompt =======================================
prompt
create table IMSP_DISPATCH_BUSI_ORDER
(
  ID          NUMBER(19) not null,
  ORDER_NAME  VARCHAR2(128 CHAR),
  ORDER_SEQ   VARCHAR2(128 CHAR),
  STATUS      NUMBER(10),
  OPERATOR_ID NUMBER(10),
  INSERT_TIME TIMESTAMP(6),
  BEGIN_TIME  TIMESTAMP(6),
  END_TIME    TIMESTAMP(6),
  DESCRIPTION VARCHAR2(1024 CHAR)
)
;
alter table IMSP_DISPATCH_BUSI_ORDER
  add constraint PK_IMSP_DISPATCH_BUSI_ORDER primary key (ID);

prompt
prompt Creating table IMSP_DISPATCH_TASK
prompt =================================
prompt
create table IMSP_DISPATCH_TASK
(
  ID          NUMBER(19) not null,
  ORDER_ID    NUMBER(19),
  STATION_ID  NUMBER(19),
  OBJ_CLASS   VARCHAR2(128 CHAR),
  OBJ_NAME    VARCHAR2(128 CHAR),
  OBJ_ACTION  VARCHAR2(510 CHAR),
  OBJ_ID      NUMBER(19),
  PRIORITY    NUMBER(10),
  TYPE        NUMBER(10),
  TASK_LEVEL  NUMBER(10),
  STATUS      NUMBER(10),
  INSERT_TIME TIMESTAMP(6),
  BEGIN_TIME  TIMESTAMP(6),
  END_TIME    TIMESTAMP(6),
  UPDATE_TIME TIMESTAMP(6),
  OPERATOR_ID NUMBER(19)
)
;
alter table IMSP_DISPATCH_TASK
  add constraint PK_IMSP_DISPATCH_TASK primary key (ID);
create index INX_DISPATCH_TASK_STATUS on IMSP_DISPATCH_TASK (STATION_ID, UPDATE_TIME, STATUS);

prompt
prompt Creating table IMSP_DISPATCH_CMD
prompt ================================
prompt
create table IMSP_DISPATCH_CMD
(
  ID            NUMBER(19) not null,
  TASK_ID       NUMBER(19),
  STATION_ID    NUMBER(19),
  OBJ_NAME      VARCHAR2(128 CHAR),
  OBJ_CLASS     VARCHAR2(128 CHAR),
  OBJ_ID        NUMBER(19),
  INSERT_TIME   TIMESTAMP(6),
  BEGIN_TIME    TIMESTAMP(6),
  END_TIME      TIMESTAMP(6),
  STATUS        NUMBER(10),
  FILE_URL      VARCHAR2(512 CHAR),
  RESPONSE_URL  VARCHAR2(512 CHAR),
  ERROR_DESC    VARCHAR2(1024 CHAR),
  COMMAND_LEVEL NUMBER(10),
  RETRY_COUNT   NUMBER(2),
  OBJ_CODE      VARCHAR2(128 CHAR),
  OBJ_TYPE      VARCHAR2(128 CHAR),
  OBJ_ACTION    VARCHAR2(128 CHAR)
)
;
alter table IMSP_DISPATCH_CMD
  add constraint PK_IMSP_DISPATCH_CMD primary key (ID);
alter table IMSP_DISPATCH_CMD
  add constraint FK_CMD_REF_TASK foreign key (TASK_ID)
  references IMSP_DISPATCH_TASK (ID);
create index INX_DISPATCH_CMD_STATION on IMSP_DISPATCH_CMD (STATION_ID);
create index INX_DISPATCH_CMD_STATUS on IMSP_DISPATCH_CMD (STATUS);
create index INX_DISPATCH_CMD_TASK on IMSP_DISPATCH_CMD (TASK_ID);

prompt
prompt Creating table IMSP_DISPATCH_RESPONSE
prompt =====================================
prompt
create table IMSP_DISPATCH_RESPONSE
(
  ID           NUMBER(19) not null,
  CSP_ID       VARCHAR2(32 CHAR) not null,
  LSP_ID       VARCHAR2(32 CHAR) not null,
  CORRELATE_ID NUMBER(19) not null,
  CMD_RESULT   NUMBER(2) not null,
  FILE_URL     VARCHAR2(1024 CHAR),
  TYPE         NUMBER(2)
)
;
alter table IMSP_DISPATCH_RESPONSE
  add constraint PK_IMSP_DISPATCH_RESPONSE primary key (ID);

prompt
prompt Creating table IMSP_ENUMDATA
prompt ============================
prompt
create table IMSP_ENUMDATA
(
  ID             NUMBER(19) not null,
  DATA_NAME      VARCHAR2(64 CHAR),
  DATA_CODE      VARCHAR2(64 CHAR),
  DATA_VALUE     VARCHAR2(64 CHAR),
  DATA_PARENT_ID NUMBER(19),
  DATA_STATUS    NUMBER(1),
  TYPE           NUMBER(1)
)
;
alter table IMSP_ENUMDATA
  add constraint PK_IMSP_ENUMDATA primary key (ID);

prompt
prompt Creating table IMSP_EPG_SITE
prompt ============================
prompt
create table IMSP_EPG_SITE
(
  ID          NUMBER(19) not null,
  NAME        VARCHAR2(128 CHAR),
  CODE        VARCHAR2(128 CHAR),
  DESCRIPTION VARCHAR2(256 CHAR),
  CREATE_TIME DATE,
  UPDATE_TIME DATE,
  OPERATOR_ID NUMBER(19)
)
;
alter table IMSP_EPG_SITE
  add constraint PK_IMSP_EPG_SITE primary key (ID);

prompt
prompt Creating table IMSP_EPG_STATION
prompt ===============================
prompt
create table IMSP_EPG_STATION
(
  ID         NUMBER(19) not null,
  SITE_ID    NUMBER(19),
  CODE       VARCHAR2(128 CHAR),
  STATION_ID NUMBER(19)
)
;
alter table IMSP_EPG_STATION
  add constraint PK_IMSP_EPG_STATION primary key (ID);
alter table IMSP_EPG_STATION
  add constraint FK_GROUP_REF_EPGSITE foreign key (SITE_ID)
  references IMSP_EPG_SITE (ID);

prompt
prompt Creating table IMSP_EXPORTTASK
prompt ==============================
prompt
create table IMSP_EXPORTTASK
(
  EXPORT_TASK_ID   VARCHAR2(128 CHAR) not null,
  FILE_NAME        VARCHAR2(128 CHAR),
  START_TIME       DATE,
  TASK_STATE       NUMBER(10),
  FILE_DESTINATION VARCHAR2(256 CHAR)
)
;
alter table IMSP_EXPORTTASK
  add constraint PK_IMSP_EXPORT_TASK primary key (EXPORT_TASK_ID);

prompt
prompt Creating table IMSP_GUIDE
prompt =========================
prompt
create table IMSP_GUIDE
(
  ID            NUMBER(19) not null,
  NAME          VARCHAR2(128 CHAR),
  STATUS        NUMBER(2),
  VALID_TIME    DATE,
  EXPIRE_TIME   DATE,
  CREATE_TIME   DATE,
  UPDATE_TIME   DATE,
  DISPATCH_TIME DATE,
  OPERATOR_ID   NUMBER(19)
)
;
alter table IMSP_GUIDE
  add constraint PK_IMSP_GUIDE primary key (ID);

prompt
prompt Creating table IMSP_GUIDE_SCHEDULE
prompt ==================================
prompt
create table IMSP_GUIDE_SCHEDULE
(
  ID            NUMBER(19) not null,
  NAME          VARCHAR2(128 CHAR),
  TYPE          VARCHAR2(128 CHAR),
  OBJ_VALUE     VARCHAR2(256 CHAR),
  GUIDE_ID      NUMBER(19) not null,
  INTERVAL      NUMBER(19) not null,
  OBJ_NAME      VARCHAR2(128 CHAR),
  SEQUENCE      NUMBER(19) default 0,
  ENABLE_STATUS NUMBER(19) default 0
)
;
alter table IMSP_GUIDE_SCHEDULE
  add constraint PK_IMSP_GUIDE_SCHEDULE primary key (ID);
alter table IMSP_GUIDE_SCHEDULE
  add constraint FK_GUIDESCHEDULE_REF_GUIDE foreign key (GUIDE_ID)
  references IMSP_GUIDE (ID);

prompt
prompt Creating table IMSP_MEDIA_FILE
prompt ==============================
prompt
create table IMSP_MEDIA_FILE
(
  ID              NUMBER(19) not null,
  CODE            VARCHAR2(128 CHAR),
  SOURCE_URL      VARCHAR2(512 CHAR),
  STORAGE_ID      NUMBER(19),
  PATH            VARCHAR2(512 CHAR),
  NAME            VARCHAR2(128 CHAR),
  TYPE            NUMBER(1),
  USE_SPACE       NUMBER(19),
  FILE_SIZE       NUMBER(19),
  VIDEO_FORMAT    VARCHAR2(128 CHAR),
  SOURCE_DRM_TYPE NUMBER(2),
  DEST_DRM_TYPE   NUMBER(2),
  AUDIO_TYPE      NUMBER(2),
  SCREEN_FORMAT   NUMBER(10),
  CLOSED_CAP      NUMBER(10),
  STATUS          NUMBER(10),
  EXTERNAL_ID     VARCHAR2(256 CHAR),
  INSERT_TIME     TIMESTAMP(6),
  UPDATE_TIME     TIMESTAMP(6),
  OPERATOR_ID     NUMBER(19),
  SOURCE          VARCHAR2(32 CHAR),
  OLD_ID          VARCHAR2(128 CHAR),
  OCS_URL         VARCHAR2(1024 CHAR),
  DURATION        VARCHAR2(12 CHAR),
  BITRATE_TYPE    NUMBER(3),
  VIDEO_TYPE      NUMBER(3),
  RESOLUTION      NUMBER(3),
  VIDEO_PROFILE   NUMBER(3),
  SYSTEM_LAYER    NUMBER(3),
  SERVICE_TYPE    NUMBER(3),
  AUDIO_FORMAT    NUMBER(3),
  MOVIE_TYPE      NUMBER(10),
  BITRATE         NUMBER(16),
  RES             VARCHAR2(16 CHAR),
  MD5             VARCHAR2(32 CHAR)
)
;
comment on table IMSP_MEDIA_FILE
  is '媒体文件表';
comment on column IMSP_MEDIA_FILE.CODE
  is '媒体文件编码';
comment on column IMSP_MEDIA_FILE.SOURCE_URL
  is '文件源路径';
comment on column IMSP_MEDIA_FILE.STORAGE_ID
  is '存储标识ID';
comment on column IMSP_MEDIA_FILE.PATH
  is '文件存储路径';
comment on column IMSP_MEDIA_FILE.NAME
  is '文件名';
comment on column IMSP_MEDIA_FILE.TYPE
  is '媒体文件用途：
1：正片
2：预览片';
comment on column IMSP_MEDIA_FILE.USE_SPACE
  is '占用空间';
comment on column IMSP_MEDIA_FILE.FILE_SIZE
  is '文件大小';
comment on column IMSP_MEDIA_FILE.VIDEO_FORMAT
  is '编码格式';
comment on column IMSP_MEDIA_FILE.SOURCE_DRM_TYPE
  is '源DRM类型:0：无DRM
1：BESTV DRM';
comment on column IMSP_MEDIA_FILE.DEST_DRM_TYPE
  is '目标DRM类型:0：无DRM
1：BESTV DRM';
comment on column IMSP_MEDIA_FILE.AUDIO_TYPE
  is '音频类型:0: 其他
1: Monaural 单声道
2: Stereo 多声道
3: Two-nation monaural 双单声道
4: Two-nation stereo 双多声道
5: AC3(5:1 channel) AC3声道';
comment on column IMSP_MEDIA_FILE.SCREEN_FORMAT
  is '制式:0: 4x3
1: 16x9(Wide)';
comment on column IMSP_MEDIA_FILE.CLOSED_CAP
  is '字幕标志
0:无字幕
1:有字幕';
comment on column IMSP_MEDIA_FILE.STATUS
  is '节目的媒体文件状态:
-1；已删除
1：等待传输；
2：传输中
3：传输失败
4：传输完成
5：文件已删除';
comment on column IMSP_MEDIA_FILE.EXTERNAL_ID
  is '外部ID';
comment on column IMSP_MEDIA_FILE.INSERT_TIME
  is '创建时间';
comment on column IMSP_MEDIA_FILE.UPDATE_TIME
  is '修改时间';
comment on column IMSP_MEDIA_FILE.OPERATOR_ID
  is '操作员ID';
comment on column IMSP_MEDIA_FILE.SOURCE
  is '来源';
alter table IMSP_MEDIA_FILE
  add constraint PK_IMSP_MEDIA_FILE primary key (ID);
create unique index INX_MEDIA_FILE_CODE on IMSP_MEDIA_FILE (CODE);

prompt
prompt Creating table IMSP_MONITOR_RECOM
prompt =================================
prompt
create table IMSP_MONITOR_RECOM
(
  ID              NUMBER(19) not null,
  RECOMGROUP_NAME VARCHAR2(128 CHAR),
  RECOMGROUP_CODE VARCHAR2(128 CHAR),
  POSITION_NAME   VARCHAR2(128 CHAR),
  POSITION_CODE   VARCHAR2(128 CHAR),
  ITEM_NAME       VARCHAR2(128 CHAR),
  ITEM_TYPE       VARCHAR2(32 CHAR),
  ITEM_VALUE      VARCHAR2(256 CHAR),
  ITEM_STYLE      VARCHAR2(16 CHAR),
  LINK_TYPE       VARCHAR2(32 CHAR),
  LINK_VALUE      VARCHAR2(256 CHAR),
  VALID_TIME      DATE,
  EXPIRE_TIME     DATE,
  DISPATCH_TIME   TIMESTAMP(6)
)
;
alter table IMSP_MONITOR_RECOM
  add constraint PK_IMSP_MONITOR_RECOM primary key (ID);

prompt
prompt Creating table IMSP_MONITOR_SUBJECT
prompt ===================================
prompt
create table IMSP_MONITOR_SUBJECT
(
  ID            NUMBER(19) not null,
  SUBJECT_NAME  VARCHAR2(128 CHAR),
  SUBJECT_CODE  VARCHAR2(128 CHAR),
  PAGE_NAME     VARCHAR2(128 CHAR),
  PAGE_CODE     VARCHAR2(128 CHAR),
  POSITION      VARCHAR2(32 CHAR),
  OBJ_NAME      VARCHAR2(128 CHAR),
  OBJ_CODE      VARCHAR2(128 CHAR),
  OBJ_TYPE      VARCHAR2(16 CHAR),
  DISPATCH_TIME DATE
)
;
comment on table IMSP_MONITOR_SUBJECT
  is '驻地专辑监控';
alter table IMSP_MONITOR_SUBJECT
  add constraint PK_IMSP_MONITOR_SUBJECT primary key (ID);

prompt
prompt Creating table IMSP_MULTI_VIDEO
prompt ===============================
prompt
create table IMSP_MULTI_VIDEO
(
  ID            NUMBER(19) not null,
  NAME          VARCHAR2(128 CHAR),
  TYPE          NUMBER(2) not null,
  STATUS        NUMBER(2) not null,
  VALID_TIME    TIMESTAMP(6),
  CREATE_TIME   TIMESTAMP(6),
  UPDATE_TIME   TIMESTAMP(6),
  DISPATCH_TIME TIMESTAMP(6),
  SOURCE        VARCHAR2(32 CHAR)
)
;
alter table IMSP_MULTI_VIDEO
  add constraint PK_IMSP_MULTI_VIDEO primary key (ID);

prompt
prompt Creating table IMSP_MULTI_VIDEO_PARAMS
prompt ======================================
prompt
create table IMSP_MULTI_VIDEO_PARAMS
(
  KEY   VARCHAR2(128 CHAR) not null,
  VALUE VARCHAR2(128 CHAR) not null
)
;
alter table IMSP_MULTI_VIDEO_PARAMS
  add constraint PK_IMSP_MULTI_VIDEO_PARAMS primary key (KEY);

prompt
prompt Creating table IMSP_MULTI_VIDEO_REGION
prompt ======================================
prompt
create table IMSP_MULTI_VIDEO_REGION
(
  ID         NUMBER(19) not null,
  VIDEO_ID   NUMBER(19) not null,
  STATUS     NUMBER(2),
  POSITION   VARCHAR2(128 CHAR),
  VIDEO_NAME VARCHAR2(128 CHAR),
  VIDEO_TYPE VARCHAR2(16 CHAR),
  VIDEO_CODE VARCHAR2(128 CHAR),
  LINK_TYPE  VARCHAR2(16 CHAR),
  LINK_VALUE VARCHAR2(128 CHAR),
  LINK_NAME  VARCHAR2(128 CHAR)
)
;
alter table IMSP_MULTI_VIDEO_REGION
  add constraint PK_IMSP_MULTI_VIDEO_REGION primary key (ID);

prompt
prompt Creating table IMSP_NEWS
prompt ========================
prompt
create table IMSP_NEWS
(
  ID              NUMBER(12) not null,
  NAME            VARCHAR2(128 CHAR),
  TITLE           VARCHAR2(128 CHAR),
  CODE            VARCHAR2(128 CHAR),
  TYPE            NUMBER(2),
  SOURCE          VARCHAR2(128 CHAR),
  AUTHOR          VARCHAR2(128 CHAR),
  PUBLISH_TIME    DATE,
  CONTENT         VARCHAR2(3000 CHAR),
  TAGS            VARCHAR2(128 CHAR),
  PROGRAM_STATUS  NUMBER(2),
  PROGRAM_CODE    VARCHAR2(128 CHAR),
  PROGRAM_TYPE    NUMBER(4),
  STATUS          NUMBER(2),
  AUDITING_STATUS NUMBER(2),
  VALID_TIME      DATE,
  EXPIRE_TIME     DATE,
  CREATE_TIME     DATE,
  UPDATE_TIME     DATE,
  OPERATOR_ID     NUMBER(12),
  AUDITING_DATE   DATE,
  DELIVER_DATE    DATE,
  COLLECT_SOURCE  VARCHAR2(64 CHAR),
  PROGRAM_LENGTH  NUMBER(19)
)
;
alter table IMSP_NEWS
  add constraint PK_IMSP_NEWS primary key (ID);

prompt
prompt Creating table IMSP_NEWS_CATEGORY
prompt =================================
prompt
create table IMSP_NEWS_CATEGORY
(
  ID              NUMBER(12) not null,
  NAME            VARCHAR2(128 CHAR),
  CODE            VARCHAR2(128 CHAR),
  VALID_TIME      DATE,
  EXPIRE_TIME     DATE,
  PARENT_ID       NUMBER(12),
  TEMPLATE_CODE   VARCHAR2(128 CHAR),
  LOCATION_STRING VARCHAR2(256 CHAR),
  ORDER_NUMBER    NUMBER(4),
  STATUS          NUMBER(2),
  SOURCE          VARCHAR2(64 CHAR)
)
;
alter table IMSP_NEWS_CATEGORY
  add constraint PK_IMSP_NEWS_CATEGORY primary key (ID);

prompt
prompt Creating table IMSP_OFFLINE_TASK
prompt ================================
prompt
create table IMSP_OFFLINE_TASK
(
  ID           NUMBER(19) not null,
  CONTENT_ID   NUMBER(19),
  ACTION       VARCHAR2(16 CHAR),
  CREATE_TIME  TIMESTAMP(6),
  EXECUTE_TIME TIMESTAMP(6),
  OPERATOR     VARCHAR2(32 CHAR),
  STATUS       NUMBER(2),
  UPDATE_TIME  DATE,
  STATION_IDS  VARCHAR2(128 CHAR)
)
;
alter table IMSP_OFFLINE_TASK
  add constraint PK_IMSP_OFFLINE_TASK primary key (ID);
alter table IMSP_OFFLINE_TASK
  add constraint FK_IMSP_OFFLINE_TASK foreign key (CONTENT_ID)
  references IMSP_CONTENT_BASE (CONTENT_ID);
create index INX_OFFLINE_TASK_STATUS on IMSP_OFFLINE_TASK (STATUS);

prompt
prompt Creating table IMSP_OPERATE_LOG
prompt ===============================
prompt
create table IMSP_OPERATE_LOG
(
  ID          NUMBER(19) not null,
  OBJ_IDS     VARCHAR2(256 CHAR),
  OBJ_CLASS   VARCHAR2(256 CHAR),
  OBJ_TYPE    VARCHAR2(256 CHAR),
  OP_TIME     TIMESTAMP(6),
  OP_TYPE     NUMBER(4),
  OP_DESC     VARCHAR2(2048 CHAR),
  OP_RESULT   NUMBER(10),
  ERROR_DESC  VARCHAR2(2048 CHAR),
  OPERATOR_ID NUMBER(19)
)
;
alter table IMSP_OPERATE_LOG
  add constraint PK_IMSP_OPERATE_LOG primary key (ID);

prompt
prompt Creating table IMSP_ORGANIZATION
prompt ================================
prompt
create table IMSP_ORGANIZATION
(
  ID         NUMBER(19) not null,
  ORG_NAME   VARCHAR2(128 CHAR),
  ORG_CODE   VARCHAR2(128 CHAR),
  ORG_STATUS NUMBER(10),
  PATH       VARCHAR2(128 CHAR),
  PARENT_ID  NUMBER(19)
)
;
alter table IMSP_ORGANIZATION
  add constraint PK_IMSP_ORGANIZATION primary key (ID);

prompt
prompt Creating table IMSP_SP
prompt ======================
prompt
create table IMSP_SP
(
  ID   NUMBER(19) not null,
  NAME VARCHAR2(128 CHAR) not null,
  CODE VARCHAR2(128 CHAR) not null
)
;
comment on table IMSP_SP
  is 'CP/SP';
alter table IMSP_SP
  add constraint PK_IMSP_SP primary key (ID);
  
prompt
prompt Creating table IMSP_OPERATOR
prompt ============================
prompt
create table IMSP_OPERATOR
(
  ID          NUMBER(19) not null,
  NAME        VARCHAR2(32 CHAR),
  LOGIN_NAME  VARCHAR2(32 CHAR),
  PASSWORD    VARCHAR2(64 CHAR),
  STATUS      NUMBER(2),
  ORG_ID      NUMBER(19),
  PATH        VARCHAR2(128 CHAR),
  OPERATOR_ID NUMBER(19),
  SP_ID       NUMBER not null
)
;
alter table IMSP_OPERATOR
  add constraint PK_IMSP_OPERATOR primary key (ID);
alter table IMSP_OPERATOR
  add constraint FK_OPERATOR_REL_ORG foreign key (ORG_ID)
  references IMSP_ORGANIZATION (ID);
alter table IMSP_OPERATOR
  add constraint FK_OPERATOR_SP foreign key (SP_ID)
  references IMSP_SP (ID);

prompt
prompt Creating table IMSP_PARAMETERS
prompt ==============================
prompt
create table IMSP_PARAMETERS
(
  KEY         VARCHAR2(128 CHAR) not null,
  VALUE       VARCHAR2(256 CHAR),
  DESCRIPTION VARCHAR2(128 CHAR)
)
;
alter table IMSP_PARAMETERS
  add constraint PK_IMSP_PARAMETERS primary key (KEY);

prompt
prompt Creating table IMSP_PERMISSION
prompt ==============================
prompt
create table IMSP_PERMISSION
(
  ID         NUMBER(19) not null,
  NAME       VARCHAR2(128 CHAR),
  PATH       VARCHAR2(128 CHAR),
  TYPE       NUMBER(2),
  CODE       NUMBER(19),
  PARENT_ID  NUMBER(19),
  IMAGE_PATH VARCHAR2(256 CHAR),
  URL_PATH   VARCHAR2(256 CHAR),
  ORDER_NUM  NUMBER(10) default 0
)
;
alter table IMSP_PERMISSION
  add constraint PK_IMSP_PERMISSION primary key (ID);

prompt
prompt Creating table IMSP_PICTURE_FILE
prompt ================================
prompt
create table IMSP_PICTURE_FILE
(
  ID          NUMBER(19) not null,
  CODE        VARCHAR2(128 CHAR),
  SOURCE_URL  VARCHAR2(512 CHAR),
  STORAGE_ID  NUMBER(19),
  PATH        VARCHAR2(512 CHAR),
  NAME        VARCHAR2(128 CHAR),
  TYPE        NUMBER(2),
  USE_SPACE   NUMBER(19),
  FILE_SIZE   NUMBER(19),
  EXTERNAL_ID VARCHAR2(256 CHAR),
  STATUS      NUMBER(2),
  DESCRIPTION VARCHAR2(1024 CHAR),
  INSERT_TIME TIMESTAMP(6),
  UPDATE_TIME TIMESTAMP(6),
  OPERATOR_ID NUMBER(19),
  SOURCE      VARCHAR2(32 CHAR),
  OLD_ID      VARCHAR2(128 CHAR),
  MD5         VARCHAR2(32 CHAR),
  PIC_SIZE    VARCHAR2(16 CHAR)
)
;
comment on table IMSP_PICTURE_FILE
  is '图片文件表';
comment on column IMSP_PICTURE_FILE.CODE
  is '文件编码';
comment on column IMSP_PICTURE_FILE.SOURCE_URL
  is '源文件路径';
comment on column IMSP_PICTURE_FILE.STORAGE_ID
  is '存储ID';
comment on column IMSP_PICTURE_FILE.PATH
  is '存储路径';
comment on column IMSP_PICTURE_FILE.NAME
  is '文件名称';
comment on column IMSP_PICTURE_FILE.TYPE
  is '文件类型';
comment on column IMSP_PICTURE_FILE.USE_SPACE
  is '占用空间';
comment on column IMSP_PICTURE_FILE.FILE_SIZE
  is '文件大小';
comment on column IMSP_PICTURE_FILE.EXTERNAL_ID
  is '外部ID';
comment on column IMSP_PICTURE_FILE.STATUS
  is '节目的媒体文件状态:
-1；已删除
1：等待传输；
2：传输中
3：传输失败
4：传输完成
5：文件已删除';
comment on column IMSP_PICTURE_FILE.DESCRIPTION
  is '描述信息';
comment on column IMSP_PICTURE_FILE.INSERT_TIME
  is '创建时间';
comment on column IMSP_PICTURE_FILE.UPDATE_TIME
  is '更新时间';
comment on column IMSP_PICTURE_FILE.OPERATOR_ID
  is '操作员ID';
comment on column IMSP_PICTURE_FILE.SOURCE
  is '来源';
alter table IMSP_PICTURE_FILE
  add constraint PK_IMSP_PICTURE_FILE primary key (ID);
create unique index INX_PICTURE_FILE_CODE on IMSP_PICTURE_FILE (CODE);

prompt
prompt Creating table IMSP_POSITION
prompt ============================
prompt
create table IMSP_POSITION
(
  ID            NUMBER(12) not null,
  NAME          VARCHAR2(128 CHAR),
  CODE          VARCHAR2(128 CHAR),
  DESCRIPTION   VARCHAR2(256 CHAR),
  CREATE_TIME   DATE,
  UPDATE_TIME   DATE,
  OPERATOR_ID   NUMBER(19),
  VALID_TIME    DATE,
  EXPIRE_TIME   DATE,
  SOURCE        VARCHAR2(32 CHAR),
  STA_STATUS    NUMBER(2) default 0,
  DISPATCH_TIME TIMESTAMP(6),
  STATUS        NUMBER(2) default 0
)
;
comment on table IMSP_POSITION
  is '推荐位';
comment on column IMSP_POSITION.NAME
  is '推荐位名称';
comment on column IMSP_POSITION.CODE
  is '推荐位编码';
comment on column IMSP_POSITION.DESCRIPTION
  is '描述信息';
comment on column IMSP_POSITION.CREATE_TIME
  is '创建时间';
comment on column IMSP_POSITION.UPDATE_TIME
  is '修改时间';
comment on column IMSP_POSITION.OPERATOR_ID
  is '操作员ID';
comment on column IMSP_POSITION.VALID_TIME
  is '生效时间';
comment on column IMSP_POSITION.EXPIRE_TIME
  is '失效时间';
comment on column IMSP_POSITION.SOURCE
  is '来源';
comment on column IMSP_POSITION.STA_STATUS
  is '下发状态';
comment on column IMSP_POSITION.DISPATCH_TIME
  is '下发时间';
comment on column IMSP_POSITION.STATUS
  is '状态';
alter table IMSP_POSITION
  add constraint PK_IMSP_POSITION primary key (ID);

prompt
prompt Creating table IMSP_POSITION_ITEM
prompt =================================
prompt
create table IMSP_POSITION_ITEM
(
  ID            NUMBER(12) not null,
  POSITION_ID   NUMBER(12),
  VALID_TIME    DATE,
  EXPIRE_TIME   DATE,
  TYPE          VARCHAR2(32 CHAR),
  VALUE         VARCHAR2(256 CHAR),
  LINK_TYPE     VARCHAR2(32 CHAR),
  LINK_VALUE    VARCHAR2(256 CHAR),
  ENABLE_STATUS NUMBER(10),
  SOURCE        VARCHAR2(64 CHAR),
  STYLE         VARCHAR2(16 CHAR),
  DESCRIPTION   VARCHAR2(256 CHAR),
  TXT           VARCHAR2(256 CHAR)
)
;
comment on table IMSP_POSITION_ITEM
  is '显示元素';
comment on column IMSP_POSITION_ITEM.POSITION_ID
  is '推荐位ID';
comment on column IMSP_POSITION_ITEM.VALID_TIME
  is '生效时间';
comment on column IMSP_POSITION_ITEM.EXPIRE_TIME
  is '失效时间';
comment on column IMSP_POSITION_ITEM.TYPE
  is '显示类型:video：显示视频片段
image：显示图片';
comment on column IMSP_POSITION_ITEM.VALUE
  is '显示对象:当显示类型为video时，该值为节目的唯一编码
当显示类型为image时，该值为图片文件相对访问路径';
comment on column IMSP_POSITION_ITEM.LINK_TYPE
  is '关联类型:url：链接到外部链接
vod：链接到指定节目
channel：链接到直播频道或聚场
subject：链接到专辑
tvbar：链接到看吧
tvgather：链接到新聚场';
comment on column IMSP_POSITION_ITEM.LINK_VALUE
  is '关联对象:当关联类型为url时，该值为外部链接字符串，其他情况该值为具体对象的唯一编码';
comment on column IMSP_POSITION_ITEM.ENABLE_STATUS
  is '错误码';
comment on column IMSP_POSITION_ITEM.SOURCE
  is '来源';
comment on column IMSP_POSITION_ITEM.STYLE
  is '字符样式(文字的颜色)';
comment on column IMSP_POSITION_ITEM.DESCRIPTION
  is '描述';
alter table IMSP_POSITION_ITEM
  add constraint PK_IMSP_POSITION_ITEM primary key (ID);
alter table IMSP_POSITION_ITEM
  add constraint FK_ITEM_REF_POSITION foreign key (POSITION_ID)
  references IMSP_POSITION (ID);

prompt
prompt Creating table IMSP_RECOM_GROUP
prompt ===============================
prompt
create table IMSP_RECOM_GROUP
(
  ID          NUMBER(19) not null,
  STATUS      NUMBER(2),
  NAME        VARCHAR2(128 CHAR),
  CODE        VARCHAR2(128 CHAR),
  DESCRIPTION VARCHAR2(256 CHAR),
  CREATE_TIME DATE,
  UPDATE_TIME DATE,
  SOURCE      VARCHAR2(32 CHAR)
)
;
alter table IMSP_RECOM_GROUP
  add constraint PK_IMSP_RECOM_GROUP primary key (ID);

prompt
prompt Creating table IMSP_RECOM_ITEM
prompt ==============================
prompt
create table IMSP_RECOM_ITEM
(
  ID            NUMBER(19) not null,
  POSITION_ID   NUMBER(19),
  STATUS        NUMBER(2),
  NAME          VARCHAR2(128 CHAR),
  CODE          VARCHAR2(128 CHAR),
  TYPE          VARCHAR2(32 CHAR),
  VALUE         VARCHAR2(256 CHAR),
  LINK_TYPE     VARCHAR2(32 CHAR),
  LINK_VALUE    VARCHAR2(256 CHAR),
  STYLE         VARCHAR2(16 CHAR),
  VALID_TIME    DATE,
  EXPIRE_TIME   DATE,
  IS_DEFAULT    NUMBER(2),
  ENABLE_STATUS NUMBER(19),
  SOURCE        VARCHAR2(32 CHAR)
)
;
alter table IMSP_RECOM_ITEM
  add constraint PK_IMSP_RECOM_ITEM primary key (ID);

prompt
prompt Creating table IMSP_RECOM_POSITION
prompt ==================================
prompt
create table IMSP_RECOM_POSITION
(
  ID          NUMBER(19) not null,
  STATUS      NUMBER(2),
  GROUP_ID    NUMBER(19),
  NAME        VARCHAR2(128 CHAR),
  CODE        VARCHAR2(128 CHAR),
  DESCRIPTION VARCHAR2(256 CHAR),
  INTERVAL    NUMBER(19),
  LOCKER      NUMBER(2) default 0
)
;
alter table IMSP_RECOM_POSITION
  add constraint PK_IMSP_RECOM_POSITION primary key (ID);

prompt
prompt Creating table IMSP_RECOM_SCHEDULE
prompt ==================================
prompt
create table IMSP_RECOM_SCHEDULE
(
  ID          NUMBER(19) not null,
  POSITION_ID NUMBER(19),
  ITEM_ID     NUMBER(19),
  VALID_TIME  DATE,
  EXPIRE_TIME DATE
)
;
alter table IMSP_RECOM_SCHEDULE
  add constraint PK_IMSP_RECOM_SCHEDULE primary key (ID);

prompt
prompt Creating table IMSP_REL_CAST_FILE
prompt =================================
prompt
create table IMSP_REL_CAST_FILE
(
  ID          NUMBER(19) not null,
  FILE_ID     NUMBER(19),
  CAST_ID     NUMBER(19),
  TYPE        NUMBER(10),
  STATUS      NUMBER(10),
  UPDATE_TIME TIMESTAMP(6),
  OPERATOR_ID NUMBER(19)
)
;
alter table IMSP_REL_CAST_FILE
  add constraint PK_IMSP_REL_CAST_FILE primary key (ID);
alter table IMSP_REL_CAST_FILE
  add constraint FK_CAST_REF_PICTURE foreign key (FILE_ID)
  references IMSP_PICTURE_FILE (ID);
alter table IMSP_REL_CAST_FILE
  add constraint FK_PICTRUE_REF_CAST foreign key (CAST_ID)
  references IMSP_CAST (ID);

prompt
prompt Creating table IMSP_REL_CATEGORY_BUSI
prompt =====================================
prompt
create table IMSP_REL_CATEGORY_BUSI
(
  ID          NUMBER(19) not null,
  CATEGORY_ID NUMBER(19),
  OBJ_ID      NUMBER(19),
  SEQUENCE    NUMBER(4),
  INSERT_TIME DATE,
  UPDATE_TIME DATE,
  STATUS      NUMBER(2),
  OPERATOR_ID NUMBER(19),
  SOURCE      VARCHAR2(64 CHAR)
)
;
comment on table IMSP_REL_CATEGORY_BUSI
  is '业务编排表';
comment on column IMSP_REL_CATEGORY_BUSI.CATEGORY_ID
  is '分类ID';
comment on column IMSP_REL_CATEGORY_BUSI.OBJ_ID
  is '业务对象ID';
comment on column IMSP_REL_CATEGORY_BUSI.SEQUENCE
  is '顺序号';
comment on column IMSP_REL_CATEGORY_BUSI.INSERT_TIME
  is '编入时间';
comment on column IMSP_REL_CATEGORY_BUSI.UPDATE_TIME
  is '更新时间';
comment on column IMSP_REL_CATEGORY_BUSI.STATUS
  is '状态';
comment on column IMSP_REL_CATEGORY_BUSI.OPERATOR_ID
  is '操作员ID';
comment on column IMSP_REL_CATEGORY_BUSI.SOURCE
  is '来源';
alter table IMSP_REL_CATEGORY_BUSI
  add constraint PK_IMSP_REL_CATEGORY_BUSI primary key (ID);

prompt
prompt Creating table IMSP_REL_CATEGORY_CONTENT
prompt ========================================
prompt
create table IMSP_REL_CATEGORY_CONTENT
(
  ID            NUMBER(19) not null,
  CATEGORY_ID   NUMBER(19),
  CONTENT_ID    NUMBER(19),
  STATUS        NUMBER(10),
  UPDATE_TIME   TIMESTAMP(6),
  OPERATOR_ID   NUMBER(19),
  CONTENT_INDEX NUMBER(4) default 999,
  LOCAL         NUMBER(2) default 1
)
;
alter table IMSP_REL_CATEGORY_CONTENT
  add constraint PK_IMSP_REL_CATEGORY_CONTENT primary key (ID);
alter table IMSP_REL_CATEGORY_CONTENT
  add constraint FK_CATEGRY_REF_CONTENT foreign key (CONTENT_ID)
  references IMSP_CONTENT_BASE (CONTENT_ID);
alter table IMSP_REL_CATEGORY_CONTENT
  add constraint FK_CONTENT_REF_CATEGORY foreign key (CATEGORY_ID)
  references IMSP_CATEGORY (ID);
create index INX_RCC_CATEGORY on IMSP_REL_CATEGORY_CONTENT (CATEGORY_ID);
create index INX_RCC_CONTENT on IMSP_REL_CATEGORY_CONTENT (CONTENT_ID);

prompt
prompt Creating table IMSP_REL_CATEGORY_FILE
prompt =====================================
prompt
create table IMSP_REL_CATEGORY_FILE
(
  ID          NUMBER(19) not null,
  CATEGORY_ID NUMBER(19),
  FILE_ID     NUMBER(19),
  TYPE        NUMBER(10),
  STATUS      NUMBER(10),
  UPDATE_TIME TIMESTAMP(6),
  OPERATOR_ID NUMBER(19)
)
;
alter table IMSP_REL_CATEGORY_FILE
  add constraint PK_IMSP_REL_CATEGORY_FILE primary key (ID);
alter table IMSP_REL_CATEGORY_FILE
  add constraint FK_CATEGORY_REF_PICTURE foreign key (FILE_ID)
  references IMSP_PICTURE_FILE (ID);
alter table IMSP_REL_CATEGORY_FILE
  add constraint FK_PICTURE_REF_CATEGORY foreign key (CATEGORY_ID)
  references IMSP_CATEGORY (ID);

prompt
prompt Creating table IMSP_REL_CATEGORY_NEWS
prompt =====================================
prompt
create table IMSP_REL_CATEGORY_NEWS
(
  ID          NUMBER(12) not null,
  CATEGORY_ID NUMBER(12),
  NEWS_ID     NUMBER(12),
  VALID_TIME  DATE,
  EXPIRE_TIME DATE,
  INSERT_TIME DATE,
  TYPE        NUMBER(2)
)
;
alter table IMSP_REL_CATEGORY_NEWS
  add constraint PK_IMSP_REL_CATEGORY_NEWS primary key (ID);
alter table IMSP_REL_CATEGORY_NEWS
  add constraint FK_CATEGORY_REF_NEWS foreign key (NEWS_ID)
  references IMSP_NEWS (ID);
alter table IMSP_REL_CATEGORY_NEWS
  add constraint FK_NEWS_REF_CATEGORY foreign key (CATEGORY_ID)
  references IMSP_NEWS_CATEGORY (ID);

prompt
prompt Creating table IMSP_REL_CONTENT_CASTROLE
prompt ========================================
prompt
create table IMSP_REL_CONTENT_CASTROLE
(
  ID          NUMBER(19) not null,
  CONTENT_ID  NUMBER(19),
  ROLE_ID     NUMBER(19),
  STATUS      NUMBER(10),
  UPDATE_TIME TIMESTAMP(6),
  OPERATOR_ID NUMBER(19)
)
;
alter table IMSP_REL_CONTENT_CASTROLE
  add constraint PK_IMSP_REL_CONTENT_CASTROLE primary key (ID);
alter table IMSP_REL_CONTENT_CASTROLE
  add constraint FK_CONTENT_REF_ROLE foreign key (ROLE_ID)
  references IMSP_CAST_ROLE (ID);
alter table IMSP_REL_CONTENT_CASTROLE
  add constraint FK_ROLE_REF_CONTENT foreign key (CONTENT_ID)
  references IMSP_CONTENT_BASE (CONTENT_ID);

prompt
prompt Creating table IMSP_REL_CONTENT_FILE
prompt ====================================
prompt
create table IMSP_REL_CONTENT_FILE
(
  ID          NUMBER(19) not null,
  CONTENT_ID  NUMBER(19),
  FILE_ID     NUMBER(19),
  TYPE        NUMBER(10),
  FILE_INDEX  NUMBER(10),
  STATUS      NUMBER(10),
  UPDATE_TIME TIMESTAMP(6),
  OPERATOR_ID NUMBER(19)
)
;
alter table IMSP_REL_CONTENT_FILE
  add constraint PK_IMSP_REL_CONTENT_FILE primary key (ID);
alter table IMSP_REL_CONTENT_FILE
  add constraint FK_CONTENT_REF_PICTURE foreign key (FILE_ID)
  references IMSP_PICTURE_FILE (ID);
alter table IMSP_REL_CONTENT_FILE
  add constraint FK_PICTURE_REF_CONTENT foreign key (CONTENT_ID)
  references IMSP_CONTENT_BASE (CONTENT_ID);

prompt
prompt Creating table IMSP_REL_CONTENT_MEDIA
prompt =====================================
prompt
create table IMSP_REL_CONTENT_MEDIA
(
  ID          NUMBER(19) not null,
  FILE_ID     NUMBER(19),
  CONTENT_ID  NUMBER(19),
  STATUS      NUMBER(10),
  UPDATE_TIME TIMESTAMP(6),
  OPERATOR_ID NUMBER(19)
)
;
alter table IMSP_REL_CONTENT_MEDIA
  add constraint PK_IMSP_REL_CONTENT_MEDIA primary key (ID);
alter table IMSP_REL_CONTENT_MEDIA
  add constraint FK_CONTENT_REF_MEDIA foreign key (FILE_ID)
  references IMSP_MEDIA_FILE (ID);
alter table IMSP_REL_CONTENT_MEDIA
  add constraint FK_MEDIA_REF_CONTENT foreign key (CONTENT_ID)
  references IMSP_CONTENT_BASE (CONTENT_ID);

prompt
prompt Creating table IMSP_SERVICE
prompt ===========================
prompt
create table IMSP_SERVICE
(
  ID           NUMBER(19) not null,
  NAME         VARCHAR2(128 CHAR),
  CODE         VARCHAR2(128 CHAR),
  STATUS       NUMBER(1),
  TYPE         NUMBER(2),
  LIFECYCLE    NUMBER(19),
  PRICE        NUMBER(8),
  DESCRIPTION  VARCHAR2(1024 CHAR),
  SORT_NAME    VARCHAR2(80 CHAR),
  SEARCH_NAME  VARCHAR2(80 CHAR),
  ORDER_NUMBER NUMBER(10),
  VALID_TIME   TIMESTAMP(6),
  EXPIRE_TIME  TIMESTAMP(6),
  CREATE_TIME  TIMESTAMP(6),
  UPDATE_TIME  TIMESTAMP(6),
  OPERATOR_ID  NUMBER(19),
  OLD_ID       VARCHAR2(128 CHAR),
  SP_CODE      VARCHAR2(32 CHAR),
  SOURCE       VARCHAR2(32)
)
;
comment on table IMSP_SERVICE
  is '资费策略信息表';
comment on column IMSP_SERVICE.STATUS
  is '兼容原来的Package信息
0：失效
1：生效';
comment on column IMSP_SERVICE.TYPE
  is '0：免费
1：按次
2：包周
3：包月';
comment on column IMSP_SERVICE.LIFECYCLE
  is '按照计费类型计算出来的周期，单位：小时';
comment on column IMSP_SERVICE.PRICE
  is '费用，单位：分';
comment on column IMSP_SERVICE.SORT_NAME
  is '原来Package的属性';
comment on column IMSP_SERVICE.SEARCH_NAME
  is '原来Package的属性';
comment on column IMSP_SERVICE.VALID_TIME
  is '原有Package的属性';
comment on column IMSP_SERVICE.EXPIRE_TIME
  is '原有Package的属性';
alter table IMSP_SERVICE
  add constraint PK_IMSP_SERVICE primary key (ID);

prompt
prompt Creating table IMSP_REL_CONTENT_SERVICE
prompt =======================================
prompt
create table IMSP_REL_CONTENT_SERVICE
(
  ID          NUMBER(19) not null,
  CONTENT_ID  NUMBER(19),
  SERVICE_ID  NUMBER(19),
  STATUS      NUMBER(1),
  UPDATE_TIME TIMESTAMP(6),
  OPERATOR_ID NUMBER(19)
)
;
comment on table IMSP_REL_CONTENT_SERVICE
  is '节目绑定的计费策略信息表';
alter table IMSP_REL_CONTENT_SERVICE
  add constraint PK_IMSP_REL_CONTENT_SERVICE primary key (ID);
alter table IMSP_REL_CONTENT_SERVICE
  add constraint FK_IMSP_CONTENT_REF_SERVICE foreign key (SERVICE_ID)
  references IMSP_SERVICE (ID);
alter table IMSP_REL_CONTENT_SERVICE
  add constraint FK_IMSP_SERVICE_REF_CONTENT foreign key (CONTENT_ID)
  references IMSP_CONTENT_BASE (CONTENT_ID);
create index INX_REL_CONTET_SERVICE on IMSP_REL_CONTENT_SERVICE (CONTENT_ID, SERVICE_ID);

prompt
prompt Creating table IMSP_REL_CONTENT_SPLIT
prompt =====================================
prompt
create table IMSP_REL_CONTENT_SPLIT
(
  ID          NUMBER(19) not null,
  CONTENT_ID  NUMBER(19),
  SPLIT_ID    NUMBER(19),
  STATUS      NUMBER(2) not null,
  UPDATE_TIME TIMESTAMP(6),
  OPERATOR_ID NUMBER(19)
)
;
alter table IMSP_REL_CONTENT_SPLIT
  add constraint PK_IMSP_REL_CONTENT_SPLIT primary key (ID);

prompt
prompt Creating table IMSP_REL_GROUP_CONTENT
prompt =====================================
prompt
create table IMSP_REL_GROUP_CONTENT
(
  ID           NUMBER(19) not null,
  GROUP_ID     NUMBER(19),
  CONTENT_ID   NUMBER(19),
  CONTENT_TYPE NUMBER(4),
  INSERT_TIME  TIMESTAMP(6)
)
;
comment on column IMSP_REL_GROUP_CONTENT.CONTENT_TYPE
  is '对应IMSP_CONTENT_BASE表中的TYPE';
alter table IMSP_REL_GROUP_CONTENT
  add constraint PK_IMSP_REL_GROUP_CONTENT primary key (ID);
alter table IMSP_REL_GROUP_CONTENT
  add constraint FK_IMSP_CONTENT_REF_GROUP foreign key (GROUP_ID)
  references IMSP_CONTENT_GROUP (ID);
alter table IMSP_REL_GROUP_CONTENT
  add constraint FK_IMSP_GROUP_REF_CONTENT foreign key (CONTENT_ID)
  references IMSP_CONTENT_BASE (CONTENT_ID);

prompt
prompt Creating table IMSP_REL_GROUP_SERVICE
prompt =====================================
prompt
create table IMSP_REL_GROUP_SERVICE
(
  ID         NUMBER(19) not null,
  GROUP_ID   NUMBER(19),
  SERVICE_ID NUMBER(19)
)
;
comment on table IMSP_REL_GROUP_SERVICE
  is '节目分组绑定的计费策略关系信息表。';
alter table IMSP_REL_GROUP_SERVICE
  add constraint PK_IMSP_REL_GROUP_SERVICE primary key (ID);
alter table IMSP_REL_GROUP_SERVICE
  add constraint FK_IMSP_GROUP_REF_SERVICE foreign key (SERVICE_ID)
  references IMSP_SERVICE (ID);
alter table IMSP_REL_GROUP_SERVICE
  add constraint FK_IMSP_SERVICE_REF_GROUP foreign key (GROUP_ID)
  references IMSP_CONTENT_GROUP (ID);

prompt
prompt Creating table IMSP_REL_MEDIA_SPLIT
prompt ===================================
prompt
create table IMSP_REL_MEDIA_SPLIT
(
  ID          NUMBER(19) not null,
  MEDIA_ID    NUMBER(19),
  SPLIT_ID    NUMBER(19),
  STATUS      NUMBER(2) not null,
  UPDATE_TIME TIMESTAMP(6),
  OPERATOR_ID NUMBER(19)
)
;
alter table IMSP_REL_MEDIA_SPLIT
  add constraint PK_IMSP_REL_MEDIA_SPLIT primary key (ID);

prompt
prompt Creating table IMSP_REL_NEWSCATE_FILE
prompt =====================================
prompt
create table IMSP_REL_NEWSCATE_FILE
(
  REL_ID      NUMBER(12) not null,
  FILE_ID     NUMBER(12),
  CATEGORY_ID NUMBER(12),
  TYPE        NUMBER(2)
)
;
alter table IMSP_REL_NEWSCATE_FILE
  add constraint PK_IMSP_REL_NEWSCATE_FILE primary key (REL_ID);
alter table IMSP_REL_NEWSCATE_FILE
  add constraint FK_NEWCATEGORY_REF_PIC foreign key (FILE_ID)
  references IMSP_PICTURE_FILE (ID);
alter table IMSP_REL_NEWSCATE_FILE
  add constraint FK_NEWSCATE_REL_FILE foreign key (CATEGORY_ID)
  references IMSP_NEWS_CATEGORY (ID);

prompt
prompt Creating table IMSP_REL_NEWS_FILE
prompt =================================
prompt
create table IMSP_REL_NEWS_FILE
(
  REL_ID     NUMBER(12) not null,
  FILE_ID    NUMBER(12),
  NEWS_ID    NUMBER(12),
  TYPE       NUMBER(2),
  FILE_INDEX NUMBER(2),
  IS_SOURCE  NUMBER(1)
)
;
alter table IMSP_REL_NEWS_FILE
  add constraint PK_IMSP_REL_NEWS_FILE primary key (REL_ID);
alter table IMSP_REL_NEWS_FILE
  add constraint FK_NEWS_REF_PIC foreign key (FILE_ID)
  references IMSP_PICTURE_FILE (ID);
alter table IMSP_REL_NEWS_FILE
  add constraint FK_NEWS_REL_FILE foreign key (NEWS_ID)
  references IMSP_NEWS (ID);

prompt
prompt Creating table IMSP_ROLE
prompt ========================
prompt
create table IMSP_ROLE
(
  ID        NUMBER(19) not null,
  ROLE_NAME VARCHAR2(128 CHAR),
  ROLE_DESC VARCHAR2(128 CHAR),
  PARENT_ID NUMBER(19),
  PATH      VARCHAR2(128 CHAR)
)
;
alter table IMSP_ROLE
  add constraint PK_IMSP_ROLE primary key (ID);

prompt
prompt Creating table IMSP_REL_OPERATOR_ROLE
prompt =====================================
prompt
create table IMSP_REL_OPERATOR_ROLE
(
  ID          NUMBER(19) not null,
  OPERATOR_ID NUMBER(19),
  ROLE_ID     NUMBER(19)
)
;
alter table IMSP_REL_OPERATOR_ROLE
  add constraint PK_IMSP_REL_OPERATOR_ROLE primary key (ID);
alter table IMSP_REL_OPERATOR_ROLE
  add constraint FK_OPERATOR_REF_ROLE foreign key (ROLE_ID)
  references IMSP_ROLE (ID);
alter table IMSP_REL_OPERATOR_ROLE
  add constraint FK_ROLE_REF_OPERATOR foreign key (OPERATOR_ID)
  references IMSP_OPERATOR (ID);

prompt
prompt Creating table IMSP_REL_OPERATOR_SP
prompt ===================================
prompt
create table IMSP_REL_OPERATOR_SP
(
  ID          NUMBER(19) not null,
  OPERATOR_ID NUMBER(19) not null,
  SP_ID       NUMBER(19) not null
)
;
alter table IMSP_REL_OPERATOR_SP
  add constraint PK_IMSP_REL_OPERATOR_SP primary key (ID);

prompt
prompt Creating table IMSP_REL_PACKAGE_FILE
prompt ====================================
prompt
create table IMSP_REL_PACKAGE_FILE
(
  ID          NUMBER(19) not null,
  PACKAGE_ID  NUMBER(19) not null,
  FILE_ID     NUMBER(19) not null,
  TYPE        NUMBER(10),
  STATUS      NUMBER(10),
  UPDATE_TIME TIMESTAMP(6),
  OPERATOR_ID NUMBER(19)
)
;
alter table IMSP_REL_PACKAGE_FILE
  add constraint PK_IMSP_REL_PACKAGE_FILE primary key (ID);

prompt
prompt Creating table IMSP_REL_ROLE_DATA
prompt =================================
prompt
create table IMSP_REL_ROLE_DATA
(
  ID        NUMBER(19) not null,
  ROLE_ID   NUMBER(19),
  OBJ_ID    NUMBER(19),
  OBJ_CLASS VARCHAR2(256 CHAR)
)
;
alter table IMSP_REL_ROLE_DATA
  add constraint PK_IMSP_REL_ROLE_DATA primary key (ID);
alter table IMSP_REL_ROLE_DATA
  add constraint FK_DATA_REF_ROLE foreign key (ROLE_ID)
  references IMSP_ROLE (ID);

prompt
prompt Creating table IMSP_REL_ROLE_PERMISSION
prompt =======================================
prompt
create table IMSP_REL_ROLE_PERMISSION
(
  ID            NUMBER(19) not null,
  ROLE_ID       NUMBER(19),
  PERMISSION_ID NUMBER(19)
)
;
alter table IMSP_REL_ROLE_PERMISSION
  add constraint PK_IMSP_REL_ROLE_PERMISSION primary key (ID);
alter table IMSP_REL_ROLE_PERMISSION
  add constraint FK_PERMISSION_REF_ROLE foreign key (ROLE_ID)
  references IMSP_ROLE (ID);
alter table IMSP_REL_ROLE_PERMISSION
  add constraint FK_ROLE_REL_PERMISSION foreign key (PERMISSION_ID)
  references IMSP_PERMISSION (ID);

prompt
prompt Creating table IMSP_REL_SERIES_EPISODE
prompt ======================================
prompt
create table IMSP_REL_SERIES_EPISODE
(
  ID            NUMBER(19) not null,
  EPISODE_ID    NUMBER(19),
  SERIES_ID     NUMBER(19),
  EPISODE_INDEX NUMBER(4),
  STATUS        NUMBER(2),
  UPDATE_TIME   TIMESTAMP(6),
  OPERATOR_ID   NUMBER(19)
)
;
comment on column IMSP_REL_SERIES_EPISODE.EPISODE_ID
  is '剧集ID';
comment on column IMSP_REL_SERIES_EPISODE.SERIES_ID
  is '连续剧ID';
comment on column IMSP_REL_SERIES_EPISODE.EPISODE_INDEX
  is '剧集号';
comment on column IMSP_REL_SERIES_EPISODE.STATUS
  is '记录状态：
0：正常状态
-1：删除状态';
comment on column IMSP_REL_SERIES_EPISODE.UPDATE_TIME
  is '修改时间';
comment on column IMSP_REL_SERIES_EPISODE.OPERATOR_ID
  is '操作员ID';
alter table IMSP_REL_SERIES_EPISODE
  add constraint PK_IMSP_REL_SERIES_EPISODE primary key (ID);
alter table IMSP_REL_SERIES_EPISODE
  add constraint FK_EPISODE_REF_SERIES foreign key (SERIES_ID)
  references IMSP_CONTENT_SERIES (CONTENT_ID);
alter table IMSP_REL_SERIES_EPISODE
  add constraint FK_EPISODE_REF_VOD foreign key (EPISODE_ID)
  references IMSP_CONTENT_BASE (CONTENT_ID);

prompt
prompt Creating table IMSP_REL_SITE_STATION
prompt ====================================
prompt
create table IMSP_REL_SITE_STATION
(
  ID          NUMBER(19) not null,
  SITE_ID     NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(10),
  UPDATE_TIME TIMESTAMP(6),
  OPERATOR_ID NUMBER(19)
)
;
alter table IMSP_REL_SITE_STATION
  add constraint PK_IMSP_REL_SITE_STATION primary key (ID);
alter table IMSP_REL_SITE_STATION
  add constraint FK_STATION_REF_SITE foreign key (SITE_ID)
  references IMSP_CATEGORY (ID);

prompt
prompt Creating table IMSP_SCHEDULE_IMPTASK
prompt ====================================
prompt
create table IMSP_SCHEDULE_IMPTASK
(
  ID          NUMBER(19) not null,
  FILE_NAME   VARCHAR2(128 CHAR) not null,
  INSERT_TIME TIMESTAMP(6),
  BEGIN_TIME  TIMESTAMP(6),
  END_TIME    TIMESTAMP(6),
  STATUS      NUMBER(2) default 0,
  ERROR_MSG   VARCHAR2(2000 CHAR),
  OPERATOR_ID NUMBER(19) not null
)
;
comment on table IMSP_SCHEDULE_IMPTASK
  is '节目单采集任务';
comment on column IMSP_SCHEDULE_IMPTASK.FILE_NAME
  is '文件名称';
comment on column IMSP_SCHEDULE_IMPTASK.STATUS
  is '处理状态：
0:待处理;
1:处理中；
2:处理成功；
3:部分成功；
4:处理失败';
alter table IMSP_SCHEDULE_IMPTASK
  add constraint PK_IMSP_SCHEDULE_IMPTASK primary key (ID);

prompt
prompt Creating table IMSP_SEARCH_ITEM
prompt ===============================
prompt
create table IMSP_SEARCH_ITEM
(
  ID       NUMBER(19) not null,
  TITLE    VARCHAR2(128 CHAR),
  CODE     VARCHAR2(128 CHAR),
  TYPE     NUMBER(4),
  SEQUENCE NUMBER(10) default 0
)
;
alter table IMSP_SEARCH_ITEM
  add constraint PK_IMSP_SEARCH_ITEM primary key (ID);

prompt
prompt Creating table IMSP_SPLIT
prompt =========================
prompt
create table IMSP_SPLIT
(
  ID          NUMBER(19) not null,
  TYPE        NUMBER(2) not null,
  STATUS      NUMBER(2) not null,
  CODE        VARCHAR2(128 CHAR),
  BODY        VARCHAR2(4000 CHAR) not null,
  INSERT_TIME TIMESTAMP(6),
  UPDATE_TIME TIMESTAMP(6),
  SOURCE      VARCHAR2(32 CHAR),
  OPERATOR_ID NUMBER(19),
  EXTERNAL_ID VARCHAR2(128 CHAR)
)
;
alter table IMSP_SPLIT
  add constraint PK_IMSP_SPLIT primary key (ID);

prompt
prompt Creating table IMSP_STATION
prompt ===========================
prompt
create table IMSP_STATION
(
  ID                NUMBER(19) not null,
  NAME              VARCHAR2(128 CHAR),
  CODE              VARCHAR2(64 CHAR),
  MEDIA_FORMAT      VARCHAR2(128 CHAR),
  INTERFACE_VERSION VARCHAR2(32 CHAR),
  QUEUE_SIZE        NUMBER(10),
  SERVICE_URL       VARCHAR2(1024 CHAR),
  CMS_SERVICE_URL   VARCHAR2(1024 CHAR),
  STATUS            NUMBER(10),
  ORG_ID            NUMBER(12),
  DISPATCH_CONFIG   NUMBER(2) default 0,
  CMD_PREFIX        VARCHAR2(16 CHAR),
  STORAGE_SPACE     NUMBER(19) default 0,
  SYSTEM_DELAY      NUMBER(10) default 0,
  DELETE_QUEUE_SIZE NUMBER(10)
)
;
alter table IMSP_STATION
  add constraint PK_IMSP_STATION primary key (ID);

prompt
prompt Creating table IMSP_STA_CAST
prompt ============================
prompt
create table IMSP_STA_CAST
(
  ID          NUMBER(19) not null,
  CAST_ID     NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_CAST
  add constraint PK_IMSP_STA_CAST primary key (ID);

prompt
prompt Creating table IMSP_STA_CASTROLE
prompt ================================
prompt
create table IMSP_STA_CASTROLE
(
  ID          NUMBER(19) not null,
  CASTROLE_ID NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_CASTROLE
  add constraint PK_IMSP_STA_CASTROLE primary key (ID);

prompt
prompt Creating table IMSP_STA_CAST_PIC
prompt ================================
prompt
create table IMSP_STA_CAST_PIC
(
  ID           NUMBER(19) not null,
  CAST_FILE_ID NUMBER(19),
  STATION_ID   NUMBER(19),
  STATUS       NUMBER(2),
  UPDATE_TIME  TIMESTAMP(6)
)
;
alter table IMSP_STA_CAST_PIC
  add constraint PK_IMSP_STA_CAST_PIC primary key (ID);

prompt
prompt Creating table IMSP_STA_CATEGORY
prompt ================================
prompt
create table IMSP_STA_CATEGORY
(
  ID          NUMBER(19) not null,
  CATEGORY_ID NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_CATEGORY
  add constraint PK_IMSP_STA_CATEGORY primary key (ID);

prompt
prompt Creating table IMSP_STA_CATEGORY_PIC
prompt ====================================
prompt
create table IMSP_STA_CATEGORY_PIC
(
  ID              NUMBER(19) not null,
  CATEGORY_PIC_ID NUMBER(19),
  STATION_ID      NUMBER(19),
  STATUS          NUMBER(2),
  UPDATE_TIME     TIMESTAMP(6)
)
;
alter table IMSP_STA_CATEGORY_PIC
  add constraint PK_IMSP_STA_CATEGORY_PIC primary key (ID);

prompt
prompt Creating table IMSP_STA_CHANNEL
prompt ===============================
prompt
create table IMSP_STA_CHANNEL
(
  ID          NUMBER(19) not null,
  CHANNEL_ID  NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_CHANNEL
  add constraint PK_IMSP_STA_CHANNEL primary key (ID);

prompt
prompt Creating table IMSP_STA_CHANNEL_PIC
prompt ===================================
prompt
create table IMSP_STA_CHANNEL_PIC
(
  ID             NUMBER(19) not null,
  CHANNEL_PIC_ID NUMBER(19),
  STATION_ID     NUMBER(19),
  STATUS         NUMBER(2),
  UPDATE_TIME    TIMESTAMP(6)
)
;
alter table IMSP_STA_CHANNEL_PIC
  add constraint PK_IMSP_STA_CHANNEL_PIC primary key (ID);

prompt
prompt Creating table IMSP_STA_CONTENT
prompt ===============================
prompt
create table IMSP_STA_CONTENT
(
  ID             NUMBER(19) not null,
  CONTENT_ID     NUMBER(19),
  CONTENT_STATUS NUMBER(10),
  STATION_ID     NUMBER(19),
  STATUS         NUMBER(2),
  UPDATE_TIME    TIMESTAMP(6)
)
;
alter table IMSP_STA_CONTENT
  add constraint PK_IMSP_STA_CONTENT primary key (ID);
create index INX_STA_CONTENT on IMSP_STA_CONTENT (CONTENT_ID, STATION_ID);

prompt
prompt Creating table IMSP_STA_CON_CAT
prompt ===============================
prompt
create table IMSP_STA_CON_CAT
(
  ID          NUMBER(19) not null,
  CON_CAT_ID  NUMBER(19),
  CATEGORY_ID NUMBER(19),
  CONTENT_ID  NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_CON_CAT
  add constraint PK_IMSP_STA_CON_CAT primary key (ID);

prompt
prompt Creating table IMSP_STA_CON_CSTRL
prompt =================================
prompt
create table IMSP_STA_CON_CSTRL
(
  ID           NUMBER(19) not null,
  CON_CSTRL_ID NUMBER(19),
  STATION_ID   NUMBER(19),
  STATUS       NUMBER(2),
  UPDATE_TIME  TIMESTAMP(6)
)
;
alter table IMSP_STA_CON_CSTRL
  add constraint PK_IMSP_STA_CON_CSTRL primary key (ID);

prompt
prompt Creating table IMSP_STA_CON_MEDIA
prompt =================================
prompt
create table IMSP_STA_CON_MEDIA
(
  ID           NUMBER(19) not null,
  CON_MEDIA_ID NUMBER(19),
  STATION_ID   NUMBER(19),
  STATUS       NUMBER(2),
  UPDATE_TIME  TIMESTAMP(6)
)
;
alter table IMSP_STA_CON_MEDIA
  add constraint PK_IMSP_STA_CON_MEDIA primary key (ID);

prompt
prompt Creating table IMSP_STA_CON_PIC
prompt ===============================
prompt
create table IMSP_STA_CON_PIC
(
  ID          NUMBER(19) not null,
  CON_PIC_ID  NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_CON_PIC
  add constraint PK_IMSP_STA_CON_PIC primary key (ID);

prompt
prompt Creating table IMSP_STA_CON_SER
prompt ===============================
prompt
create table IMSP_STA_CON_SER
(
  ID             NUMBER(19) not null,
  CON_SERVICE_ID NUMBER(19),
  CONTENT_ID     NUMBER(19),
  SERVICE_ID     NUMBER(19),
  STATION_ID     NUMBER(19),
  STATUS         NUMBER(2),
  UPDATE_TIME    TIMESTAMP(6)
)
;
alter table IMSP_STA_CON_SER
  add constraint PK_IMSP_STA_CON_SER primary key (ID);

prompt
prompt Creating table IMSP_STA_MEDIA_FILE
prompt ==================================
prompt
create table IMSP_STA_MEDIA_FILE
(
  ID           NUMBER(19) not null,
  MEDIAFILE_ID NUMBER(19),
  STATION_ID   NUMBER(19),
  STATUS       NUMBER(2),
  UPDATE_TIME  TIMESTAMP(6)
)
;
alter table IMSP_STA_MEDIA_FILE
  add constraint PK_IMSP_STA_MEDIA_FILE primary key (ID);

prompt
prompt Creating table IMSP_STA_PACKAGE
prompt ===============================
prompt
create table IMSP_STA_PACKAGE
(
  ID          NUMBER(19) not null,
  PACKAGE_ID  NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_PACKAGE
  add constraint PK_IMSP_STA_PACKAGE primary key (ID);

prompt
prompt Creating table IMSP_STA_PICTURE
prompt ===============================
prompt
create table IMSP_STA_PICTURE
(
  ID          NUMBER(19) not null,
  PICTURE_ID  NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_PICTURE
  add constraint PK_IMSP_STA_PICTURE primary key (ID);

prompt
prompt Creating table IMSP_STA_POSITION
prompt ================================
prompt
create table IMSP_STA_POSITION
(
  ID          NUMBER(19) not null,
  POSITION_ID NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_POSITION
  add constraint PK_IMSP_STA_POSITION primary key (ID);

prompt
prompt Creating table IMSP_STA_RECOM
prompt =============================
prompt
create table IMSP_STA_RECOM
(
  ID          NUMBER(19) not null,
  RECOM_ID    NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_RECOM
  add constraint PK_IMSP_STA_RECOM primary key (ID);

prompt
prompt Creating table IMSP_STA_SCHEDULE
prompt ================================
prompt
create table IMSP_STA_SCHEDULE
(
  ID          NUMBER(19) not null,
  SCHEDULE_ID NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_SCHEDULE
  add constraint PK_IMSP_STA_SCHEDULE primary key (ID);

prompt
prompt Creating table IMSP_STA_SER_EPISODE
prompt ===================================
prompt
create table IMSP_STA_SER_EPISODE
(
  ID             NUMBER(19) not null,
  SER_EPISODE_ID NUMBER(19),
  STATION_ID     NUMBER(19),
  STATUS         NUMBER(2),
  UPDATE_TIME    TIMESTAMP(6)
)
;
alter table IMSP_STA_SER_EPISODE
  add constraint PK_IMSP_STA_SER_EPISODE primary key (ID);

prompt
prompt Creating table IMSP_STA_SER_PIC
prompt ===============================
prompt
create table IMSP_STA_SER_PIC
(
  ID          NUMBER(19) not null,
  SER_PIC_ID  NUMBER(19) not null,
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_SER_PIC
  add constraint PK_IMSP_STA_SER_PIC primary key (ID);

prompt
prompt Creating table IMSP_STA_SUBJECT
prompt ===============================
prompt
create table IMSP_STA_SUBJECT
(
  ID          NUMBER(19) not null,
  SUBJECT_ID  NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_SUBJECT
  add constraint PK_IMSP_STA_SUBJECT primary key (ID);

prompt
prompt Creating table IMSP_STA_TEMPLATE
prompt ================================
prompt
create table IMSP_STA_TEMPLATE
(
  ID          NUMBER(19) not null,
  TEMPLATE_ID NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_TEMPLATE
  add constraint PK_IMSP_STA_TEMPLATE primary key (ID);

prompt
prompt Creating table IMSP_STA_TVBAR
prompt =============================
prompt
create table IMSP_STA_TVBAR
(
  ID          NUMBER(19) not null,
  TVBAR_ID    NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_TVBAR
  add constraint PK_IMSP_STA_TVBAR primary key (ID);

prompt
prompt Creating table IMSP_STA_TVGATHER
prompt ================================
prompt
create table IMSP_STA_TVGATHER
(
  ID          NUMBER(19) not null,
  TVGATHER_ID NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_TVGATHER
  add constraint PK_IMSP_STA_TVGATHER primary key (ID);

prompt
prompt Creating table IMSP_STA_VODLIST
prompt ===============================
prompt
create table IMSP_STA_VODLIST
(
  ID          NUMBER(19) not null,
  VODLIST_ID  NUMBER(19),
  STATION_ID  NUMBER(19),
  STATUS      NUMBER(2),
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_STA_VODLIST
  add constraint PK_IMSP_STA_VODLIST primary key (ID);

prompt
prompt Creating table IMSP_STORAGE
prompt ===========================
prompt
create table IMSP_STORAGE
(
  ID                  NUMBER(19) not null,
  NAME                VARCHAR2(128 CHAR),
  CODE                VARCHAR2(128 CHAR),
  DISK_CLUSTER        NUMBER(19),
  TYPE                NUMBER(2),
  MEDIAFORMAT         VARCHAR2(64 CHAR),
  PRIORITY            NUMBER(2),
  STATUS              NUMBER(2),
  ACCESS_STATUS       NUMBER(2),
  STORAGE_SPACE       NUMBER(19),
  USED_SPACE          NUMBER(19),
  INNER_URL           VARCHAR2(256 CHAR),
  OUTTER_INTERNAL_URL VARCHAR2(256 CHAR),
  OUTTER_INTERNET_URL VARCHAR2(256 CHAR),
  HTTP_URL            VARCHAR2(256 CHAR),
  CREATE_TIME         TIMESTAMP(6),
  UPDATE_TIME         TIMESTAMP(6),
  OPERATOR_ID         NUMBER(19),
  WARNING_SPACE       NUMBER(19) default 0,
  SP_CODE             VARCHAR2(1024 CHAR)
)
;
comment on column IMSP_STORAGE.SP_CODE
  is '存储适用的SP信息，一个存储可以适用于多个SP，多个SP Code之间采用“,”分隔';
alter table IMSP_STORAGE
  add constraint PK_IMSP_STORAGE primary key (ID);

prompt
prompt Creating table IMSP_SUBJECT
prompt ===========================
prompt
create table IMSP_SUBJECT
(
  ID            NUMBER(19) not null,
  NAME          VARCHAR2(128 CHAR),
  SHOW_NAME     VARCHAR2(128 CHAR),
  CODE          VARCHAR2(128 CHAR),
  STATUS        NUMBER(2),
  ICON          VARCHAR2(256 CHAR),
  VALID_TIME    DATE,
  EXPIRE_TIME   DATE,
  CREATE_TIME   DATE,
  UPDATE_TIME   DATE,
  OPERATOR_ID   NUMBER(19),
  DESCRIPTION   VARCHAR2(256 CHAR),
  STA_STATUS    NUMBER(2) default 0,
  SOURCE        VARCHAR2(64 CHAR),
  DISPATCH_TIME TIMESTAMP(6),
  SCREEN_FORMAT NUMBER(1),
  CONTENT_TYPE  VARCHAR2(128 CHAR),
  GENRE         VARCHAR2(128 CHAR),
  TAGS          VARCHAR2(128 CHAR)
)
;
comment on table IMSP_SUBJECT
  is '专辑';
comment on column IMSP_SUBJECT.NAME
  is '专辑名称';
comment on column IMSP_SUBJECT.SHOW_NAME
  is '显示名称';
comment on column IMSP_SUBJECT.CODE
  is '专辑编码';
comment on column IMSP_SUBJECT.STATUS
  is '专辑状态：0:正常状态；
-1：删除状态';
comment on column IMSP_SUBJECT.ICON
  is '显示图标';
comment on column IMSP_SUBJECT.VALID_TIME
  is '生效时间';
comment on column IMSP_SUBJECT.EXPIRE_TIME
  is '失效时间';
comment on column IMSP_SUBJECT.CREATE_TIME
  is '创建时间';
comment on column IMSP_SUBJECT.UPDATE_TIME
  is '修改时间';
comment on column IMSP_SUBJECT.OPERATOR_ID
  is '操作员ID';
comment on column IMSP_SUBJECT.DESCRIPTION
  is '描述';
comment on column IMSP_SUBJECT.STA_STATUS
  is '下发状态';
comment on column IMSP_SUBJECT.SOURCE
  is '来源';
comment on column IMSP_SUBJECT.DISPATCH_TIME
  is '下发时间';
alter table IMSP_SUBJECT
  add constraint PK_IMSP_SUBJECT primary key (ID);

prompt
prompt Creating table IMSP_SUBJECT_PAGE
prompt ================================
prompt
create table IMSP_SUBJECT_PAGE
(
  ID              NUMBER(19) not null,
  SUBJECT_ID      NUMBER(19),
  NAME            VARCHAR2(128 CHAR),
  CODE            VARCHAR2(128 CHAR),
  ICON            VARCHAR2(256 CHAR),
  BACKGROUD_IMAGE VARCHAR2(256 CHAR),
  FIRST_PAGE      NUMBER(1),
  SOURCE          VARCHAR2(64 CHAR)
)
;
comment on table IMSP_SUBJECT_PAGE
  is '专辑页面';
comment on column IMSP_SUBJECT_PAGE.SUBJECT_ID
  is '所属专辑ID';
comment on column IMSP_SUBJECT_PAGE.NAME
  is '专辑页面名称';
comment on column IMSP_SUBJECT_PAGE.CODE
  is '专辑页面编码';
comment on column IMSP_SUBJECT_PAGE.ICON
  is '显示图标';
comment on column IMSP_SUBJECT_PAGE.BACKGROUD_IMAGE
  is '背景图片';
comment on column IMSP_SUBJECT_PAGE.FIRST_PAGE
  is '是否默认首页：0:不是专辑默认首页
1：专辑的默认首页';
comment on column IMSP_SUBJECT_PAGE.SOURCE
  is '来源';
alter table IMSP_SUBJECT_PAGE
  add constraint PK_IMSP_SUBJECT_PAGE primary key (ID);
alter table IMSP_SUBJECT_PAGE
  add constraint FK_PAGE_REF_SUBJECT foreign key (SUBJECT_ID)
  references IMSP_SUBJECT (ID);

prompt
prompt Creating table IMSP_SUBJECT_REGION
prompt ==================================
prompt
create table IMSP_SUBJECT_REGION
(
  ID            NUMBER(19) not null,
  PAGE_ID       NUMBER(19),
  POSITION      VARCHAR2(19 CHAR),
  OBJ_TYPE      VARCHAR2(16 CHAR),
  OBJ_NAME      VARCHAR2(512 CHAR),
  OBJ_CODE      VARCHAR2(128 CHAR),
  DESCRIPTION   VARCHAR2(256 CHAR),
  ENABLE_STATUS NUMBER(10),
  SOURCE        VARCHAR2(64 CHAR),
  SEQUENCE      NUMBER(19)
)
;
comment on table IMSP_SUBJECT_REGION
  is '热点区域';
comment on column IMSP_SUBJECT_REGION.PAGE_ID
  is '所属页面ID';
comment on column IMSP_SUBJECT_REGION.POSITION
  is '区域位置';
comment on column IMSP_SUBJECT_REGION.OBJ_TYPE
  is '区域对应的对象类型取值范围如下：
vod：节目
category：节目分类
subject：专辑
page：专辑页面';
comment on column IMSP_SUBJECT_REGION.OBJ_NAME
  is '对象名称';
comment on column IMSP_SUBJECT_REGION.OBJ_CODE
  is '对象编码';
comment on column IMSP_SUBJECT_REGION.DESCRIPTION
  is '描述信息';
comment on column IMSP_SUBJECT_REGION.ENABLE_STATUS
  is '错误码';
comment on column IMSP_SUBJECT_REGION.SOURCE
  is '来源';
comment on column IMSP_SUBJECT_REGION.SEQUENCE
  is '顺序号';
alter table IMSP_SUBJECT_REGION
  add constraint PK_IMSP_SUBJECT_REGION primary key (ID);
alter table IMSP_SUBJECT_REGION
  add constraint FK_REGION_REF_PAGE foreign key (PAGE_ID)
  references IMSP_SUBJECT_PAGE (ID);

prompt
prompt Creating table IMSP_SYNC_ERROR
prompt ==============================
prompt
create table IMSP_SYNC_ERROR
(
  UPDATE_TIME TIMESTAMP(6) not null,
  ACTION      VARCHAR2(128 CHAR),
  DESCRIPTION VARCHAR2(1024 CHAR)
)
;

prompt
prompt Creating table IMSP_SYNC_LOG
prompt ============================
prompt
create table IMSP_SYNC_LOG
(
  ID           NUMBER(19) not null,
  ACTION       VARCHAR2(32 CHAR),
  UPDATE_DATE  TIMESTAMP(6),
  DESCRPIPTION VARCHAR2(1024 CHAR)
)
;
alter table IMSP_SYNC_LOG
  add constraint PK_IMSP_SYNC_LOG primary key (ID);
create unique index INX_SYN_LOG_ACTION on IMSP_SYNC_LOG (ACTION);

prompt
prompt Creating table IMSP_TEMPLATE
prompt ============================
prompt
create table IMSP_TEMPLATE
(
  ID          NUMBER(19) not null,
  NAME        VARCHAR2(128 CHAR),
  CODE        VARCHAR2(128 CHAR),
  TYPE        NUMBER(2),
  AUTHOR      VARCHAR2(128 CHAR),
  VERSION     VARCHAR2(128 CHAR),
  DESCRIPTION VARCHAR2(256 CHAR),
  CREATE_TIME DATE,
  UPDATE_TIME DATE,
  OPERATOR_ID NUMBER(19),
  STATUS      NUMBER(2),
  STA_STATUS  NUMBER(2) default 0,
  SOURCE      VARCHAR2(64 CHAR)
)
;
alter table IMSP_TEMPLATE
  add constraint PK_IMSP_TEMPLATE primary key (ID);

prompt
prompt Creating table IMSP_TEMPLATE_BIND
prompt =================================
prompt
create table IMSP_TEMPLATE_BIND
(
  ID          NUMBER(19) not null,
  TEMPLATE_ID NUMBER(19),
  BIND_TYPE   NUMBER(2),
  BIND_ID     NUMBER(19),
  BIND_TIME   DATE
)
;
alter table IMSP_TEMPLATE_BIND
  add constraint PK_IMSP_TEMPLATE_BIND primary key (ID);
alter table IMSP_TEMPLATE_BIND
  add constraint FK_BIND_REF_TEMPLATE foreign key (TEMPLATE_ID)
  references IMSP_TEMPLATE (ID);

prompt
prompt Creating table IMSP_TEMPLATE_PARAM_DEF
prompt ======================================
prompt
create table IMSP_TEMPLATE_PARAM_DEF
(
  ID            NUMBER(19) not null,
  TEMPLATE_ID   NUMBER(19),
  PARAM_TYPE    NUMBER(2),
  PARAM_NAME    VARCHAR2(64 CHAR),
  PARAM_CODE    VARCHAR2(64 CHAR),
  DEFAULT_VALUE VARCHAR2(256 CHAR),
  SOURCE        VARCHAR2(64 CHAR)
)
;
alter table IMSP_TEMPLATE_PARAM_DEF
  add constraint PK_IMSP_TEMPLATE_PARAM_DEF primary key (ID);
alter table IMSP_TEMPLATE_PARAM_DEF
  add constraint FK_PARAMDEF_REF_TEMPLATE foreign key (TEMPLATE_ID)
  references IMSP_TEMPLATE (ID);

prompt
prompt Creating table IMSP_TEMPLATE_PARAM_INST
prompt =======================================
prompt
create table IMSP_TEMPLATE_PARAM_INST
(
  ID          NUMBER(19) not null,
  DEF_ID      NUMBER(19),
  BIND_TYPE   NUMBER(2),
  BIND_ID     NUMBER(19),
  PARAM_CODE  VARCHAR2(64 CHAR),
  PARAM_VALUE VARCHAR2(256 CHAR)
)
;
alter table IMSP_TEMPLATE_PARAM_INST
  add constraint PK_IMSP_TEMPLATE_PARAM_INST primary key (ID);
alter table IMSP_TEMPLATE_PARAM_INST
  add constraint FK_PARAMINST_REF_DEF foreign key (DEF_ID)
  references IMSP_TEMPLATE_PARAM_DEF (ID);

prompt
prompt Creating table IMSP_TRANSFER_QUEUE
prompt ==================================
prompt
create table IMSP_TRANSFER_QUEUE
(
  ID                        NUMBER(19) not null,
  REQUEST_ID                NUMBER(19),
  OBJ_NAME                  VARCHAR2(128 CHAR),
  OBJ_CLASS                 VARCHAR2(128 CHAR),
  PRIORITY                  NUMBER(2),
  STATUS                    NUMBER(2),
  BEGIN_TIME                TIMESTAMP(6),
  END_TIME                  TIMESTAMP(6),
  ACTION                    VARCHAR2(32 CHAR),
  SOURCE                    VARCHAR2(128 CHAR),
  SOURCE_TAG                VARCHAR2(128 CHAR),
  TRANSFER_QUEUE_CHANNEL_ID NUMBER(19),
  CONTENT_ID                NUMBER(19),
  FILE_SIZE                 NUMBER
)
;
comment on table IMSP_TRANSFER_QUEUE
  is '按照节目、分类等创建的文件传输队列，用以控制文件传输的优先级等';
comment on column IMSP_TRANSFER_QUEUE.OBJ_CLASS
  is '操作对象主要包括：
bestv.imsp.entity.content.VOD：节目
bestv.imsp.entity.content.Serial：连续剧
bestv.imsp.entity.category.Category:分类
bestv.imsp.entity.content.ContentGroup：节目分组
bestv.imsp.entity.content.Channel：频道
bestv.imsp.entity.content.Cast：演职员
';
comment on column IMSP_TRANSFER_QUEUE.PRIORITY
  is '分发优先级0-9，分发优先级越高，则驻地优先下载相关文件.';
comment on column IMSP_TRANSFER_QUEUE.STATUS
  is '传输队列状态：
0：等待传输
1：传输中
2：传输失败
3：传输成功
4：暂停传输，只有等待传输的队列才可以暂停
5：取消';
alter table IMSP_TRANSFER_QUEUE
  add constraint PK_IMSP_TRANSFER_QUEUE primary key (ID);
create index INX_TRANSFER_QUEUE on IMSP_TRANSFER_QUEUE (STATUS);

prompt
prompt Creating table IMSP_TRANSFER_FILE
prompt =================================
prompt
create table IMSP_TRANSFER_FILE
(
  ID          NUMBER(19) not null,
  FILE_ID     VARCHAR2(128 CHAR),
  SOURCE_FILE VARCHAR2(256 CHAR),
  TARGET_FILE VARCHAR2(256 CHAR),
  MD5         VARCHAR2(32 CHAR),
  RESUMABLE   NUMBER(1),
  QUEUE_ID    NUMBER(19),
  FILE_SIZE   NUMBER
)
;
alter table IMSP_TRANSFER_FILE
  add constraint PK_IMSP_TRANSFER_FILE primary key (ID);
alter table IMSP_TRANSFER_FILE
  add constraint FK_TRANSFER_FILE_QUEUE foreign key (QUEUE_ID)
  references IMSP_TRANSFER_QUEUE (ID);
create index INX_TRANSFER_FILE on IMSP_TRANSFER_FILE (QUEUE_ID);

prompt
prompt Creating table IMSP_TRANSFER_QUEUE_CHANNEL
prompt ==========================================
prompt
create table IMSP_TRANSFER_QUEUE_CHANNEL
(
  ID              NUMBER(19) not null,
  MAX_QUEUE       NUMBER(3),
  MAX_THREAD      NUMBER(3),
  WAIT_TIME       NUMBER(3),
  TIME_OUT        NUMBER(3),
  MAX_RETRY_TIMES NUMBER(3)
)
;
alter table IMSP_TRANSFER_QUEUE_CHANNEL
  add constraint PK_IMSP_TRANSFER_QUEUE_CHANNEL primary key (ID);

prompt
prompt Creating table IMSP_TVBAR
prompt =========================
prompt
create table IMSP_TVBAR
(
  TVBAR_ID         NUMBER(19) not null,
  NAME             VARCHAR2(128 CHAR),
  SHOW_NAME        VARCHAR2(128 CHAR),
  CODE             VARCHAR2(128 CHAR),
  STATUS           NUMBER(2),
  ICON             VARCHAR2(256 CHAR),
  BACKGROUND_IMAGE VARCHAR2(256 CHAR),
  VALID_TIME       DATE,
  EXPIRE_TIME      DATE,
  DESCRIPTION      VARCHAR2(256 CHAR),
  TEMPLATE_CODE    VARCHAR2(128 CHAR),
  CHANNEL_NUMBER   VARCHAR2(8 CHAR),
  CREATE_TIME      DATE,
  UPDATE_TIME      DATE,
  OPERATOR_ID      NUMBER(19),
  STA_STATUS       NUMBER(2) default 0,
  SOURCE           VARCHAR2(64 CHAR),
  DISPATCH_TIME    TIMESTAMP(6)
)
;
alter table IMSP_TVBAR
  add constraint PK_IMSP_TVBAR primary key (TVBAR_ID);

prompt
prompt Creating table IMSP_TVBAR_FOLDER
prompt ================================
prompt
create table IMSP_TVBAR_FOLDER
(
  FOLDER_ID        NUMBER(19) not null,
  TVBAR_ID         NUMBER(19),
  NAME             VARCHAR2(128 CHAR),
  CODE             VARCHAR2(128 CHAR),
  FOLDER_ORDER     NUMBER(4),
  VIEW_ICON        VARCHAR2(128 CHAR),
  BACKGROUND_IMAGE VARCHAR2(128 CHAR),
  SOURCE           VARCHAR2(64 CHAR)
)
;
alter table IMSP_TVBAR_FOLDER
  add constraint PK_IMSP_TVBAR_FOLDER primary key (FOLDER_ID);
alter table IMSP_TVBAR_FOLDER
  add constraint FK_FOLDER_REF_TVBAR foreign key (TVBAR_ID)
  references IMSP_TVBAR (TVBAR_ID);

prompt
prompt Creating table IMSP_TVBAR_ITEM
prompt ==============================
prompt
create table IMSP_TVBAR_ITEM
(
  ITEM_ID        NUMBER(19) not null,
  FOLDER_ID      NUMBER(19),
  TYPE           NUMBER(2),
  OBJ_TYPE       VARCHAR2(16 CHAR),
  OBJ_CODE       VARCHAR2(128 CHAR),
  ICON           VARCHAR2(256 CHAR),
  LINK_NAME      VARCHAR2(128 CHAR),
  LINK_TYPE      VARCHAR2(16 CHAR),
  LINK_CODE      VARCHAR2(128 CHAR),
  RELATION_IMAGE VARCHAR2(256 CHAR),
  ITEM_ORDER     NUMBER(4),
  DESCRIPTION    VARCHAR2(16 CHAR),
  ENABLE_STATUS  NUMBER(10),
  CHANNEL_CODE   VARCHAR2(128 CHAR),
  SOURCE         VARCHAR2(64 CHAR)
)
;
alter table IMSP_TVBAR_ITEM
  add constraint PK_IMSP_TVBAR_ITEM primary key (ITEM_ID);
alter table IMSP_TVBAR_ITEM
  add constraint FK_ITEM_REF_TVBAR foreign key (FOLDER_ID)
  references IMSP_TVBAR_FOLDER (FOLDER_ID);

prompt
prompt Creating table IMSP_TVGATHER
prompt ============================
prompt
create table IMSP_TVGATHER
(
  ID               NUMBER(19) not null,
  NAME             VARCHAR2(128 CHAR),
  SHOW_NAME        VARCHAR2(128 CHAR),
  TYPE             NUMBER(2),
  CODE             VARCHAR2(128 CHAR),
  STATUS           NUMBER(2),
  ICON             VARCHAR2(256 CHAR),
  BACKGROUND_IMAGE VARCHAR2(256 CHAR),
  TAGS             VARCHAR2(128 CHAR),
  TEMPLATE_CODE    VARCHAR2(128 CHAR),
  VALID_TIME       DATE,
  EXPIRE_TIME      DATE,
  CREATE_TIME      DATE,
  UPDATE_TIME      DATE,
  OPERATOR_ID      NUMBER(19),
  CHANNEL_NUMBER   VARCHAR2(8 CHAR),
  DESCRIPTION      VARCHAR2(1024 CHAR),
  STA_STATUS       NUMBER(2) default 0,
  SOURCE           VARCHAR2(64 CHAR),
  DISPATCH_TIME    TIMESTAMP(6)
)
;
alter table IMSP_TVGATHER
  add constraint PK_IMSP_TVGATHER primary key (ID);

prompt
prompt Creating table IMSP_TVGATHER_VODLIST
prompt ====================================
prompt
create table IMSP_TVGATHER_VODLIST
(
  ID             NUMBER(19) not null,
  TVGATHER_ID    NUMBER(19),
  VOD_CODE       VARCHAR2(128 CHAR),
  TVGATHER_INDEX NUMBER(4),
  TRAILER_FLAG   NUMBER(1),
  ENABLE_STATUS  NUMBER(10),
  SOURCE         VARCHAR2(64 CHAR)
)
;
alter table IMSP_TVGATHER_VODLIST
  add constraint PK_IMSP_TVGATHER_VODLIST primary key (ID);
alter table IMSP_TVGATHER_VODLIST
  add constraint FK_VODLIST_REF_TVGATHER foreign key (TVGATHER_ID)
  references IMSP_TVGATHER (ID);

prompt
prompt Creating table IMSP_VERSION
prompt ===========================
prompt
create table IMSP_VERSION
(
  ID            NUMBER(19) not null,
  VERSION       VARCHAR2(128 CHAR),
  PATCH_VERSION VARCHAR2(128 CHAR),
  UPDATE_TIME   TIMESTAMP(6),
  DEMO          VARCHAR2(1024 CHAR),
  SCRIPT_PATH   VARCHAR2(256 CHAR)
)
;
alter table IMSP_VERSION
  add constraint PK_IMSP_VERSION primary key (ID);

prompt
prompt Creating table IMSP_VODLIST
prompt ===========================
prompt
create table IMSP_VODLIST
(
  ID            NUMBER(19) not null,
  NAME          VARCHAR2(128 CHAR),
  CODE          VARCHAR2(128 CHAR),
  TYPE          VARCHAR2(32 CHAR),
  CATEGORY_CODE VARCHAR2(128 CHAR),
  DESCRIPTION   VARCHAR2(256 CHAR),
  CREATE_TIME   DATE,
  UPDATE_TIME   DATE,
  OPERATOR_ID   NUMBER(19),
  VALID_TIME    DATE,
  EXPIRE_TIME   DATE,
  SOURCE        VARCHAR2(32 CHAR),
  STATUS        NUMBER(2),
  STA_STATUS    NUMBER(2) default 0,
  DISPATCH_TIME TIMESTAMP(6)
)
;
alter table IMSP_VODLIST
  add constraint PK_IMSP_VODLIST primary key (ID);

prompt
prompt Creating table IMSP_VODLIST_ITEM
prompt ================================
prompt
create table IMSP_VODLIST_ITEM
(
  ID            NUMBER(19) not null,
  VODLIST_ID    NUMBER(19),
  VOD_TYPE      NUMBER(4),
  VOD_CODE      VARCHAR2(128 CHAR),
  VOD_INDEX     NUMBER(4),
  ENABLE_STATUS NUMBER(10),
  SOURCE        VARCHAR2(64 CHAR)
)
;
alter table IMSP_VODLIST_ITEM
  add constraint PK_IMSP_VODLIST_ITEM primary key (ID);
alter table IMSP_VODLIST_ITEM
  add constraint FK_ITEM_REF_VODLIST foreign key (VODLIST_ID)
  references IMSP_VODLIST (ID);

prompt
prompt Creating table IMSP_WARNING
prompt ===========================
prompt
create table IMSP_WARNING
(
  ID          NUMBER(19) not null,
  TYPE        NUMBER(4),
  SYS_CODE    VARCHAR2(128 CHAR),
  EVENT       NUMBER(4),
  CONTENT     VARCHAR2(512 CHAR),
  STATUS      NUMBER(2),
  CREATE_TIME TIMESTAMP(6),
  BEGIN_TIME  TIMESTAMP(6),
  END_TIME    TIMESTAMP(6),
  OPERATOR    VARCHAR2(128 CHAR),
  HANDLE_LOG  VARCHAR2(1024 CHAR),
  DEVICE_ID   VARCHAR2(128 CHAR),
  DEVICE_NAME VARCHAR2(128 CHAR)
)
;
alter table IMSP_WARNING
  add constraint PK_IMSP_WARNING primary key (ID);

prompt
prompt Creating table IMSP_WARNING_LOG
prompt ===============================
prompt
create table IMSP_WARNING_LOG
(
  ID          NUMBER(19) not null,
  OBJ_IDS     VARCHAR2(255),
  OBJ_CLASS   VARCHAR2(256),
  OBJ_TYPE    VARCHAR2(255),
  OP_TIME     TIMESTAMP(6),
  CODE        VARCHAR2(64),
  STATUS      NUMBER(10),
  INSERT_TIME TIMESTAMP(6),
  REMARK      VARCHAR2(512),
  OPERATOR_ID NUMBER(19)
)
;
alter table IMSP_WARNING_LOG
  add constraint PK_IMSP_WARNING_LOG primary key (ID);

prompt
prompt Creating table IMSP_WF_REGULATION
prompt =================================
prompt
create table IMSP_WF_REGULATION
(
  ID             NUMBER(19) not null,
  NAME           VARCHAR2(64 CHAR),
  CONDITION_TYPE NUMBER(2) not null,
  OBJ_CLASS      VARCHAR2(256 CHAR) not null,
  UPDATE_TIME    TIMESTAMP(6),
  OPERATOR_ID    NUMBER(19),
  STATUS         NUMBER(2) default 0
)
;
alter table IMSP_WF_REGULATION
  add constraint PK_IMSP_WF_REGULATION primary key (ID);

prompt
prompt Creating table IMSP_WF_ACTION
prompt =============================
prompt
create table IMSP_WF_ACTION
(
  ID          NUMBER(19) not null,
  KEY         VARCHAR2(256 CHAR),
  VALUE       VARCHAR2(256 CHAR),
  ACTION_TYPE NUMBER(2) not null,
  ROLE_ID     NUMBER(19) not null,
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_WF_ACTION
  add constraint PK_IMSP_WF_ACTION primary key (ID);
alter table IMSP_WF_ACTION
  add constraint FK_IMSP_WF_ACTION_ROLE_ID foreign key (ROLE_ID)
  references IMSP_WF_REGULATION (ID);

prompt
prompt Creating table IMSP_WF_CONDITION
prompt ================================
prompt
create table IMSP_WF_CONDITION
(
  ID          NUMBER(19) not null,
  KEY         VARCHAR2(256 CHAR),
  VALUE       VARCHAR2(256 CHAR),
  ROLE_ID     NUMBER(19) not null,
  UPDATE_TIME TIMESTAMP(6)
)
;
alter table IMSP_WF_CONDITION
  add constraint PK_IMSP_WF_CONDITION primary key (ID);
alter table IMSP_WF_CONDITION
  add constraint FK_IMSP_WF_CONDITION_ROLE_ID foreign key (ROLE_ID)
  references IMSP_WF_REGULATION (ID);

prompt
prompt Creating sequence IMSP_AUDIT_ORDER_SEQ
prompt ======================================
prompt
create sequence IMSP_AUDIT_ORDER_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_CAST_ROLE_SEQ
prompt ====================================
prompt
create sequence IMSP_CAST_ROLE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_CAST_SEQ
prompt ===============================
prompt
create sequence IMSP_CAST_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_CATEGORY_SEQ
prompt ===================================
prompt
create sequence IMSP_CATEGORY_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_COLLECTION_SEQ
prompt =====================================
prompt
create sequence IMSP_COLLECTION_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_COLLECT_BUSI_REQ_SEQ
prompt ===========================================
prompt
create sequence IMSP_COLLECT_BUSI_REQ_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_COLLECT_PREEDIT_SEQ
prompt ==========================================
prompt
create sequence IMSP_COLLECT_PREEDIT_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_COLLECT_REQ_SEQ
prompt ======================================
prompt
create sequence IMSP_COLLECT_REQ_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_COMMAND_CONTENT_SEQ
prompt ==========================================
prompt
create sequence IMSP_COMMAND_CONTENT_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_COMMAND_ELEMENT_SEQ
prompt ==========================================
prompt
create sequence IMSP_COMMAND_ELEMENT_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_COMMAND_POSITION_SEQ
prompt ===========================================
prompt
create sequence IMSP_COMMAND_POSITION_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_COMMAND_SCHEDULE_SEQ
prompt ===========================================
prompt
create sequence IMSP_COMMAND_SCHEDULE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_CONTENT_BASE_SEQ
prompt =======================================
prompt
create sequence IMSP_CONTENT_BASE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_CONTENT_GENRE_SEQ
prompt ========================================
prompt
create sequence IMSP_CONTENT_GENRE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_CONTENT_GROUP_SEQ
prompt ========================================
prompt
create sequence IMSP_CONTENT_GROUP_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_CONTENT_REGION_SEQ
prompt =========================================
prompt
create sequence IMSP_CONTENT_REGION_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_CONTENT_SCHEDULE_SEQ
prompt ===========================================
prompt
create sequence IMSP_CONTENT_SCHEDULE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_CONTENT_TAG_SEQ
prompt ======================================
prompt
create sequence IMSP_CONTENT_TAG_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_CONTENT_TYPE_SEQ
prompt =======================================
prompt
create sequence IMSP_CONTENT_TYPE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_DISPATCH_BUSI_CMD_SEQ
prompt ============================================
prompt
create sequence IMSP_DISPATCH_BUSI_CMD_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_DISPATCH_BUSI_ORDER_SEQ
prompt ==============================================
prompt
create sequence IMSP_DISPATCH_BUSI_ORDER_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_DISPATCH_CMD_SEQ
prompt =======================================
prompt
create sequence IMSP_DISPATCH_CMD_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_DISPATCH_RESPONSE_SEQ
prompt ============================================
prompt
create sequence IMSP_DISPATCH_RESPONSE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_DISPATCH_TASK_SEQ
prompt ========================================
prompt
create sequence IMSP_DISPATCH_TASK_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_ENUMDATA_SEQ
prompt ===================================
prompt
create sequence IMSP_ENUMDATA_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_EPG_SITE_SEQ
prompt ===================================
prompt
create sequence IMSP_EPG_SITE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_EPG_STATION_SEQ
prompt ======================================
prompt
create sequence IMSP_EPG_STATION_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_GUIDE_SCHEDULE_SEQ
prompt =========================================
prompt
create sequence IMSP_GUIDE_SCHEDULE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_GUIDE_SEQ
prompt ================================
prompt
create sequence IMSP_GUIDE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_LIFECYCLE_CONTENT_SEQ
prompt ============================================
prompt
create sequence IMSP_LIFECYCLE_CONTENT_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_MEDIA_FILE_SEQ
prompt =====================================
prompt
create sequence IMSP_MEDIA_FILE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_MONITOR_RECOM_SEQ
prompt ========================================
prompt
create sequence IMSP_MONITOR_RECOM_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_MONITOR_SUBJECT_SEQ
prompt ==========================================
prompt
create sequence IMSP_MONITOR_SUBJECT_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_MULTI_VIDEO_REGION_SEQ
prompt =============================================
prompt
create sequence IMSP_MULTI_VIDEO_REGION_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_MULTI_VIDEO_SEQ
prompt ======================================
prompt
create sequence IMSP_MULTI_VIDEO_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_NEWS_CATEGORY_SEQ
prompt ========================================
prompt
create sequence IMSP_NEWS_CATEGORY_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_NEWS_SEQ
prompt ===============================
prompt
create sequence IMSP_NEWS_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_OFFLINE_TASK_SEQ
prompt =======================================
prompt
create sequence IMSP_OFFLINE_TASK_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_OPERATE_LOG_SEQ
prompt ======================================
prompt
create sequence IMSP_OPERATE_LOG_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_OPERATOR_SEQ
prompt ===================================
prompt
create sequence IMSP_OPERATOR_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_ORGANIZATION_SEQ
prompt =======================================
prompt
create sequence IMSP_ORGANIZATION_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_PICTURE_FILE_SEQ
prompt =======================================
prompt
create sequence IMSP_PICTURE_FILE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_POSITION_ITEM_SEQ
prompt ========================================
prompt
create sequence IMSP_POSITION_ITEM_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_POSITION_SEQ
prompt ===================================
prompt
create sequence IMSP_POSITION_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_RECOM_GROUP_SEQ
prompt ======================================
prompt
create sequence IMSP_RECOM_GROUP_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_RECOM_ITEM_SEQ
prompt =====================================
prompt
create sequence IMSP_RECOM_ITEM_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_RECOM_POSITION_SEQ
prompt =========================================
prompt
create sequence IMSP_RECOM_POSITION_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_RECOM_SCHEDULE_SEQ
prompt =========================================
prompt
create sequence IMSP_RECOM_SCHEDULE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_CAST_FILE_SEQ
prompt ========================================
prompt
create sequence IMSP_REL_CAST_FILE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_CATEGORY_BUSI_SEQ
prompt ============================================
prompt
create sequence IMSP_REL_CATEGORY_BUSI_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_CATEGORY_CONTENT_SEQ
prompt ===============================================
prompt
create sequence IMSP_REL_CATEGORY_CONTENT_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_CATEGORY_FILE_SEQ
prompt ============================================
prompt
create sequence IMSP_REL_CATEGORY_FILE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_CATEGORY_NEWS_SEQ
prompt ============================================
prompt
create sequence IMSP_REL_CATEGORY_NEWS_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_CONTENT_CASTROLE_SEQ
prompt ===============================================
prompt
create sequence IMSP_REL_CONTENT_CASTROLE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_CONTENT_FILE_SEQ
prompt ===========================================
prompt
create sequence IMSP_REL_CONTENT_FILE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_CONTENT_MEDIA_SEQ
prompt ============================================
prompt
create sequence IMSP_REL_CONTENT_MEDIA_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_CONTENT_SERVICE_SEQ
prompt ==============================================
prompt
create sequence IMSP_REL_CONTENT_SERVICE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_CONTENT_SPLIT_SEQ
prompt ============================================
prompt
create sequence IMSP_REL_CONTENT_SPLIT_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_GROUP_CONTENT_SEQ
prompt ============================================
prompt
create sequence IMSP_REL_GROUP_CONTENT_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_GROUP_SERVICE_SEQ
prompt ============================================
prompt
create sequence IMSP_REL_GROUP_SERVICE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_MEDIA_SPLIT_SEQ
prompt ==========================================
prompt
create sequence IMSP_REL_MEDIA_SPLIT_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_NEWSCATE_FILE_SEQ
prompt ============================================
prompt
create sequence IMSP_REL_NEWSCATE_FILE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_NEWS_FILE_SEQ
prompt ========================================
prompt
create sequence IMSP_REL_NEWS_FILE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_OPERATOR_ROLE_SEQ
prompt ============================================
prompt
create sequence IMSP_REL_OPERATOR_ROLE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_OPERATOR_SP_SEQ
prompt ==========================================
prompt
create sequence IMSP_REL_OPERATOR_SP_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_PACKAGE_FILE_SEQ
prompt ===========================================
prompt
create sequence IMSP_REL_PACKAGE_FILE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_ROLE_DATA_SEQ
prompt ========================================
prompt
create sequence IMSP_REL_ROLE_DATA_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_ROLE_PERMISSION_SEQ
prompt ==============================================
prompt
create sequence IMSP_REL_ROLE_PERMISSION_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_SERIES_EPISODE_SEQ
prompt =============================================
prompt
create sequence IMSP_REL_SERIES_EPISODE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_REL_SITE_STATION_SEQ
prompt ===========================================
prompt
create sequence IMSP_REL_SITE_STATION_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_ROLE_SEQ
prompt ===============================
prompt
create sequence IMSP_ROLE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_SCHEDULE_IMPTASK_SEQ
prompt ===========================================
prompt
create sequence IMSP_SCHEDULE_IMPTASK_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_SEARCH_ITEM_SEQ
prompt ======================================
prompt
create sequence IMSP_SEARCH_ITEM_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_SERVICE_SEQ
prompt ==================================
prompt
create sequence IMSP_SERVICE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_SITE_SEQ
prompt ===============================
prompt
create sequence IMSP_SITE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_SPLIT_SEQ
prompt ================================
prompt
create sequence IMSP_SPLIT_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_SP_SEQ
prompt =============================
prompt
create sequence IMSP_SP_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STATION_SEQ
prompt ==================================
prompt
create sequence IMSP_STATION_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_CASTROLE_SEQ
prompt =======================================
prompt
create sequence IMSP_STA_CASTROLE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_CAST_PIC_SEQ
prompt =======================================
prompt
create sequence IMSP_STA_CAST_PIC_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_CAST_SEQ
prompt ===================================
prompt
create sequence IMSP_STA_CAST_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_CATEGORY_PIC_SEQ
prompt ===========================================
prompt
create sequence IMSP_STA_CATEGORY_PIC_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_CATEGORY_SEQ
prompt =======================================
prompt
create sequence IMSP_STA_CATEGORY_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_CHANNEL_PIC_SEQ
prompt ==========================================
prompt
create sequence IMSP_STA_CHANNEL_PIC_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_CHANNEL_SEQ
prompt ======================================
prompt
create sequence IMSP_STA_CHANNEL_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_COLUMN_SEQ
prompt =====================================
prompt
create sequence IMSP_STA_COLUMN_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_CONTENT_SEQ
prompt ======================================
prompt
create sequence IMSP_STA_CONTENT_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_CON_CAT_SEQ
prompt ======================================
prompt
create sequence IMSP_STA_CON_CAT_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_CON_CSTRL_SEQ
prompt ========================================
prompt
create sequence IMSP_STA_CON_CSTRL_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_CON_MEDIA_SEQ
prompt ========================================
prompt
create sequence IMSP_STA_CON_MEDIA_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_CON_PIC_SEQ
prompt ======================================
prompt
create sequence IMSP_STA_CON_PIC_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_CON_SER_SEQ
prompt ======================================
prompt
create sequence IMSP_STA_CON_SER_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_MEDIA_SEQ
prompt ====================================
prompt
create sequence IMSP_STA_MEDIA_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_PACKAGE_SEQ
prompt ======================================
prompt
create sequence IMSP_STA_PACKAGE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_PICTURE_SEQ
prompt ======================================
prompt
create sequence IMSP_STA_PICTURE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_POSITION_SEQ
prompt =======================================
prompt
create sequence IMSP_STA_POSITION_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_RECOM_SEQ
prompt ====================================
prompt
create sequence IMSP_STA_RECOM_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_SCHEDULE_SEQ
prompt =======================================
prompt
create sequence IMSP_STA_SCHEDULE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_SER_EPISODE_SEQ
prompt ==========================================
prompt
create sequence IMSP_STA_SER_EPISODE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_SER_PIC_SEQ
prompt ======================================
prompt
create sequence IMSP_STA_SER_PIC_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_SUBJECT_SEQ
prompt ======================================
prompt
create sequence IMSP_STA_SUBJECT_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_TEMPLATE_SEQ
prompt =======================================
prompt
create sequence IMSP_STA_TEMPLATE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_TVBAR_SEQ
prompt ====================================
prompt
create sequence IMSP_STA_TVBAR_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_TVGATHER_SEQ
prompt =======================================
prompt
create sequence IMSP_STA_TVGATHER_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STA_VODLIST_SEQ
prompt ======================================
prompt
create sequence IMSP_STA_VODLIST_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_STORAGE_SEQ
prompt ==================================
prompt
create sequence IMSP_STORAGE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_SUBJECT_PAGE_SEQ
prompt =======================================
prompt
create sequence IMSP_SUBJECT_PAGE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_SUBJECT_REGION_SEQ
prompt =========================================
prompt
create sequence IMSP_SUBJECT_REGION_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_SUBJECT_SEQ
prompt ==================================
prompt
create sequence IMSP_SUBJECT_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_SYNC_LOG_SEQ
prompt ===================================
prompt
create sequence IMSP_SYNC_LOG_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_TEMPLATE_BIND_SEQ
prompt ========================================
prompt
create sequence IMSP_TEMPLATE_BIND_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_TEMPLATE_PARAM_DEF_SEQ
prompt =============================================
prompt
create sequence IMSP_TEMPLATE_PARAM_DEF_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_TEMPLATE_PARAM_INST_SEQ
prompt ==============================================
prompt
create sequence IMSP_TEMPLATE_PARAM_INST_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_TEMPLATE_SEQ
prompt ===================================
prompt
create sequence IMSP_TEMPLATE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_TRANSFERQUEUECHANNEL_SEQ
prompt ===============================================
prompt
create sequence IMSP_TRANSFERQUEUECHANNEL_SEQ
minvalue 10
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_TRANSFER_FILE_SEQ
prompt ========================================
prompt
create sequence IMSP_TRANSFER_FILE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_TRANSFER_QUEUE_SEQ
prompt =========================================
prompt
create sequence IMSP_TRANSFER_QUEUE_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_TVBAR_FOLDER_SEQ
prompt =======================================
prompt
create sequence IMSP_TVBAR_FOLDER_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_TVBAR_ITEM_SEQ
prompt =====================================
prompt
create sequence IMSP_TVBAR_ITEM_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_TVBAR_SEQ
prompt ================================
prompt
create sequence IMSP_TVBAR_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_TVGATHER_SEQ
prompt ===================================
prompt
create sequence IMSP_TVGATHER_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_TVGATHER_VODLIST_SEQ
prompt ===========================================
prompt
create sequence IMSP_TVGATHER_VODLIST_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_VERSION_SEQ
prompt ==================================
prompt
create sequence IMSP_VERSION_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_VODLIST_ITEM_SEQ
prompt =======================================
prompt
create sequence IMSP_VODLIST_ITEM_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_VODLIST_SEQ
prompt ==================================
prompt
create sequence IMSP_VODLIST_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_WARNING_LOG_SEQ
prompt ======================================
prompt
create sequence IMSP_WARNING_LOG_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_WARNING_SEQ
prompt ==================================
prompt
create sequence IMSP_WARNING_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_WF_ACTION_SEQ
prompt ====================================
prompt
create sequence IMSP_WF_ACTION_SEQ
minvalue 100
maxvalue 999999999999999999999999999
start with 100
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_WF_CONDITION_SEQ
prompt =======================================
prompt
create sequence IMSP_WF_CONDITION_SEQ
minvalue 100
maxvalue 999999999999999999999999999
start with 100
increment by 1
cache 20;

prompt
prompt Creating sequence IMSP_WF_REGULATION_SEQ
prompt ========================================
prompt
create sequence IMSP_WF_REGULATION_SEQ
minvalue 100
maxvalue 999999999999999999
start with 100
increment by 1
cache 20;

prompt
prompt Creating view IMSP_BASE_CONTENT_VIEW
prompt ====================================
prompt
CREATE OR REPLACE VIEW IMSP_BASE_CONTENT_VIEW AS
SELECT c.content_id      AS id,
    c.name            AS name,
    c.type            AS type,
    c.code            AS code,
    c.tags            AS tags,
    c.status          AS status,
    c.create_time     AS create_time,
    c.length          AS length
FROM imsp_content_base c;

prompt
prompt Creating view IMSP_BRANCH_CONTENT_VIEW
prompt ======================================
prompt
create or replace view imsp_branch_content_view as
select sta.code as branch_code,
	c.code as content_code,
	decode(stacon.content_status,0,0,1,0,2,0,3,1) as status,
	stacon.update_time as update_time
from imsp_sta_content stacon,imsp_content_base c,imsp_station sta
where stacon.content_id=c.content_id and stacon.station_id=sta.id and stacon.update_time < sysdate;

prompt
prompt Creating view IMSP_CATEGORY_VIEW
prompt ================================
prompt
create or replace view imsp_category_view as
select c1.id,
	c1.code,
	c1.name,
	c1.status,
	c1.type as type,
	c1.parent_id as parent_id,
	c1.sequence as order_number,
	c1.path,
	c1.update_time,
	c1.create_time,
	(select code from imsp_category c where c.id=c1.parent_id ) as parent_code
from imsp_category c1;

prompt
prompt Creating view IMSP_CHANNEL_VIEW
prompt ===============================
prompt
create or replace view imsp_channel_view as
select b.code as code,
	b.name as name,
	b.genre as genre,
	b.tags as tags,
	b.keyword as keywords,
	b.enable_status as status,
	b.type as type,
	c.description as description,
	c.channel_number as channel_number,
	c.call_sign as call_sign,
	c.time_shift as time_shift,
	c.storage_duration as storage_duration,
	c.time_shift_duration as time_shift_duration,
	c.country as country,
	c.state as state,
	c.city as city,
	c.zip_code as zip_code,
	c.language as language,
	c.start_time as start_time,
	c.end_time as end_time,
	c.bitrate_type as bitrate,
	c.multicast_ip as multicast_ip,
	c.multicast_port as multicast_port,
	b.update_time as update_time
from imsp_content_base b,imsp_content_channel c
where b.content_id = c.content_id;
prompt
prompt Creating view IMSP_CONTENT_PICTURE_VIEW
prompt =======================================
prompt
create or replace view imsp_content_picture_view as
select b.code as content_code,
	decode(b.type,1000,'Program',3100,'Program',3000,'Series',4000,'Channel',5000,'Channel',6000,'Channel') as content_type,
	rel.type as type,
	f.path as path,
	rel.status as status,
	GREATEST(rel.update_time,f.update_time) as update_time
from imsp_content_base b,imsp_rel_content_file rel,imsp_picture_file f
where b.content_id=rel.content_id and rel.file_id = f.id;

prompt
prompt Creating view IMSP_PROGRAM_VIEW
prompt ===============================
prompt
CREATE OR REPLACE VIEW IMSP_PROGRAM_VIEW AS
SELECT b.code                     AS code,
    b.name                          AS name,
    b.content_type                  AS content_type,
    b.genre                         AS genre,
    b.keyword                       AS keywords,
    b.tags                          AS tags,
    b.enable_status                 AS status,
    b.ori_name                      AS ori_name,
    v.actor_display                 AS actor_display,
    v.writer_display                AS writer_display,
    b.srarch_name                   AS search_name,
    b.sort_name                     AS sort_name,
    v.issue_year                    AS issue_year,
    v.origin_date                   AS origin_date,
    v.company                       AS company,
    v.region                        AS region,
    b.update_time                   AS update_time,
    b.type                          AS type,
    v.descirption                   AS description,
    b.length                        AS LENGTH,
    b.status                        AS cms_status,
    NVL2((select max(series.episode_number) from imsp_content_series series,imsp_rel_series_episode rel where series.content_id = rel.series_id and rel.episode_id = b.content_id ) ,(select max(series.episode_number) from imsp_content_series series,imsp_rel_series_episode rel where series.content_id = rel.series_id and rel.episode_id = b.content_id ) ,0)
    AS episode_number,
    NVL2(b.r_media_code,b.r_media_code,b.code)      AS opt_code,
    b.hd                            AS hd
    FROM imsp_content_base b join
    imsp_content_vod v on b.content_id=v.content_id;

prompt
prompt Creating view IMSP_REL_CATEGORY_CONTENT_VIEW
prompt ============================================
prompt
create or replace view imsp_rel_category_content_view as
select rel.id as id,
	cat.code as category_code,
	con.code as content_code,
	con.name as content_name,
	decode(con.type,1000,1,3100,1,3000,2,4000,3,5000,3,6000,3) as content_type,
	rel.content_index as item_order,
	rel.status as status,
	rel.update_time as update_time
from imsp_content_base con ,imsp_category cat,imsp_rel_category_content rel 
where con.content_id=rel.content_id and cat.id=rel.category_id;

prompt
prompt Creating view IMSP_SCHEDULE_VIEW
prompt ================================
prompt
create or replace view imsp_schedule_view as
select s.id as id,
	s.code as code,
	s.channel_code as channel_code,
	s.name as name,
	s.start_date as start_date,
	s.start_time as start_time,
	s.end_time as end_time,
	s.duration_time as duration,
	s.status as status,
	s.genre as genre,
	s.tags as tags,
	s.keywords as keywords,
	s.description as description,
	s.update_time as update_time
from imsp_content_schedule s
where s.start_date > sysdate-2;

prompt
prompt Creating view IMSP_SERIES_EPISODE_VIEW
prompt ======================================
prompt
create or replace view imsp_series_episode_view as
select a.id,
	a.status,
	a.update_time, 
	a.episode_index, 
	b.code as episode_code, 
	c.code as series_code
from imsp_rel_series_episode a, imsp_content_base b, imsp_content_base c
where a.episode_id = b.content_id and a.series_id = c.content_id;

prompt
prompt Creating view IMSP_SERIES_VIEW
prompt ==============================
prompt
create or replace view imsp_series_view as
select b.code as code,
	b.name as name,
	b.enable_status as status,
	s.episode_number as episode_number,
	b.content_type as content_type,
	b.genre as genre,
	b.tags as tags,
	b.keyword as keywords,
	s.descirption as description,
	b.ori_name as ori_name,
	s.actor_display as actor_display,
	s.writer_display as writer_display,
	b.srarch_name as search_name,
	b.sort_name as sort_name,
	s.company as company,
	s.region as region,
	b.update_time as update_time,
	b.status as cms_status
from imsp_content_base b, imsp_content_series s
where b.content_id = s.content_id;

prompt
prompt Creating view VAS_BUSINESS_CONTENT_VIEW
prompt =======================================
prompt
create or replace view vas_business_content_view as
select 'TVBAR' as biz, name as biz_name, code as biz_code, category_name, category_code, item_name, item_code
from vas_tvbar_list_view@vis.bestv.com
union all
select 'SUBJECT' as biz,subject_name as biz_name, code as biz_code,'' as category_name,'' as category_code,name as item_name, obj_code as item_code from vas_subject_list_view@vis.bestv.com;

prompt
prompt Creating function FUN_VISURL
prompt ============================
prompt
CREATE OR REPLACE FUNCTION fun_visurl(biz_type VARCHAR2,biz_code VARCHAR2) RETURN VARCHAR2 AS
	vis_url VARCHAR(1024);
BEGIN
	
	select fun_visurl@vis.bestv.com(biz_type, biz_code) into vis_url from dual;
	
	RETURN vis_url;
END;
/

prompt
prompt Creating view VAS_BUSINESS_STATUS_VIEW
prompt ======================================
prompt
create or replace view vas_business_status_view as
select 'TVBAR' as BIZ,ID,NAME,CODE,SHOW_FLAG,null as CREATE_TIME,fun_visurl('tvbar', CODE) as URL from vas_biz_view@vis.bestv.com
union all
select 'SUBJECT' as BIZ,ID,NAME,CODE,SHOW_FLAG,null as CREATE_TIME,fun_visurl('subject', CODE) as URL from vas_subject_view_for_cms@vis.bestv.com;

prompt
prompt Creating function CAST_TO_RAW
prompt =============================
prompt
CREATE OR REPLACE FUNCTION cast_to_raw(str VARCHAR2) RETURN RAW AS
BEGIN     
	--RETURN UTL_RAW.CONVERT(UTL_RAW.cast_to_raw(str),'AMERICAN_AMERICA.ZHS16GBK','AMERICAN_AMERICA.UTF8');
  RETURN UTL_RAW.cast_to_raw(str);
END;
/

prompt
prompt Creating function FUN_CATEGORYS_PATH
prompt ====================================
prompt
create or replace function fun_categorys_path(ctt_id number) return varchar2 as
	v_categorys_path varchar2(1024);
    v_category_path varchar2(1024);
    v_category_name varchar2(256);
	v_category_id number(19);
begin
	for category in (select * from imsp_category where id in (select category_id from imsp_rel_category_content where content_id = ctt_id and status = 0))
    loop
        v_category_path := category.name ;
        v_category_id := category.parent_id;
        while v_category_id is not null 
        loop
            select name into v_category_name from imsp_category where id=v_category_id;
            select parent_id into v_category_id from imsp_category where id=v_category_id;
            v_category_path := v_category_name || '/' || v_category_path;
        end loop;
        if length(v_categorys_path) + length(v_category_path) > 1024 then 
            exit;
        end if;
        v_categorys_path :=  v_categorys_path || v_category_path || ';' ; 
    end loop;
	return v_categorys_path;
end;
/

prompt
prompt Creating function FUN_EPGSUBJECT
prompt ================================
prompt
create or replace function 
fun_epgsubject(ctt_code varchar2) return varchar2 as 
	v_epgsubject varchar(1024);
	v_subject varchar(1024);
begin
	v_epgsubject := '';
    for epgsubject in (select * from imsp_subject_region  where obj_code = ctt_code)
    loop
        select name into v_subject from imsp_subject where id = (select subject_id from imsp_subject_page where id = epgsubject.page_id);
        if length(v_epgsubject) + length(v_subject) > 1024 then 
            exit;
        end if;
        v_epgsubject := v_epgsubject || v_subject || ';';
    end loop;
    return v_epgsubject;
end;
/

prompt
prompt Creating function FUN_VISBAR
prompt ============================
prompt
create or replace function 
fun_visbar(ctt_code varchar2) return varchar2 as 
	v_visbar varchar2(1024);
begin
	v_visbar := '';
    for visbar in (select * from vas_business_content_view where biz = 'TVBAR' and item_code = ctt_code )
    loop
        if length(v_visbar) + length(visbar.biz_name) > 1024 then
            exit;
        end if;
        v_visbar := v_visbar || visbar.biz_name || ';';
    end loop;
    return v_visbar;
end;
/

prompt
prompt Creating function FUN_VISSUBJECT
prompt ================================
prompt
create or replace function 
fun_vissubject(ctt_code varchar2) return varchar2 as 
	v_vissubject varchar(1024);
begin
	v_vissubject := '';
    for vissubject in (select * from vas_business_content_view where biz = 'SUBJECT' and item_code = ctt_code )
    loop
        if length(v_vissubject) + length(vissubject.biz_name) > 1024 then
            exit;
        end if;
        v_vissubject := v_vissubject || vissubject.biz_name || ';';
    end loop;
	return v_vissubject;
end;
/

prompt
prompt Creating procedure IMSP_CATEGORY_STATISTIC_SYNC
prompt ===============================================
prompt
create or replace procedure IMSP_CATEGORY_STATISTIC_SYNC is

    v_errcode number;
    v_errmsg varchar2(100);
    v_count number;
    v_length number;
    v_isleaf number;
    v_file_size number;
    v_file_size_temp1 number;
    v_file_size_temp2 number;
begin
    --  sync records from imsp_category to imsp_category_statistic
    FOR categorys in (select * from IMSP_CATEGORY where type=1)
    LOOP
        select count(*) into v_count from IMSP_CATEGORY_STATISTIC where id = categorys.id;
        if categorys.status != -1 then

          if v_count is null or v_count = 0 then
              insert into IMSP_CATEGORY_STATISTIC (ID,NAME,CODE,PARENT_ID,SEQUENCE) values (categorys.id,categorys.name,categorys.code,categorys.parent_id,categorys.sequence);
              commit;
          else
              update IMSP_CATEGORY_STATISTIC set NAME=categorys.name, CODE=categorys.code, PARENT_ID=categorys.parent_id, SEQUENCE=categorys.sequence where ID=categorys.id;
              commit;
          end if;

        else
          if v_count != 0 then
              delete IMSP_CATEGORY_STATISTIC where ID=categorys.id;
              commit;
          end if;
        end if;

    END LOOP;

    --  update all the infos in IMSP_CATEGORY_STATISTIC
    -- change the condition "parent_id is null" if necessary
    FOR categorystat in (SELECT id,parent_id,LEVEL AS n_level FROM imsp_category_statistic START WITH parent_id is null CONNECT BY PRIOR id =  parent_id order by n_level desc)
    LOOP
        select count(*) into v_isleaf from imsp_category_statistic where parent_id=categorystat.id;
        -- leaf
        if v_isleaf = 0 then
          select decode(sum(base.length),null,0,sum(base.length)) into v_length from imsp_rel_category_content cate, imsp_content_base base where cate.content_id = base.content_id and cate.status=0 and cate.category_id = categorystat.id;
          select count(*) into v_count from imsp_rel_category_content cate, imsp_content_base base where cate.content_id = base.content_id and cate.status=0 and cate.category_id = categorystat.id;

          select decode(sum(media.file_size),null,0,sum(media.file_size)) into v_file_size_temp1
              from imsp_rel_category_content cate, imsp_rel_content_media cm, imsp_media_file media
              where   cm.file_id = media.id and cate.content_id = cm.content_id
              and cate.status = 0 and cate.category_id = categorystat.id;

          select decode(sum(media.file_size),null,0,sum(media.file_size)) into v_file_size_temp2
              from imsp_rel_category_content cate, imsp_rel_series_episode se, imsp_rel_content_media cm, imsp_media_file media
              where   cm.file_id = media.id and se.episode_id = cm.content_id and se.series_id = cate.content_id
              and cate.status = 0 and cate.category_id = categorystat.id;

          v_file_size := v_file_size_temp1 + v_file_size_temp2;
          update IMSP_CATEGORY_STATISTIC set ISLEAF=1,PROGRAM_NUMBER=v_count, PROGRAM_LENGTH=v_length, PROGRAM_SIZE=v_file_size where id=categorystat.id;
          commit;


        -- not leaf
        else
            FOR stats in(select sum(cs.program_number) as program_number, sum(cs.program_size) as program_size, sum(cs.program_length) as program_length from imsp_category_statistic cs
              where   cs.parent_id = categorystat.id)
            LOOP
                v_length := stats.program_length;
                update IMSP_CATEGORY_STATISTIC set ISLEAF=0,PROGRAM_NUMBER=stats.program_number, PROGRAM_LENGTH=stats.program_length, PROGRAM_SIZE=stats.program_size where id=categorystat.id;
                commit;
            END LOOP;
            -- update percent
            if v_length = 0 then
                v_length := 1;
            end if;
            FOR stat in(select id,program_length from imsp_category_statistic where parent_id = categorystat.id)
            LOOP
                update IMSP_CATEGORY_STATISTIC set program_percent=stat.program_length*100/v_length where id=stat.id;
                commit;
            END LOOP;

        end if;

    END LOOP;

    Exception
      when others Then
      Begin
         ROLLBACK;
            v_errcode  :=   sqlcode;
            v_errmsg   :=   substr(sqlerrm,1,512);
            insert into IMSP_SYNC_ERROR(UPDATE_TIME,ACTION,DESCRIPTION) values(sysdate,'categoryStatistic','error code:' ||v_errcode || ',error message:' || v_errmsg );
            commit;
      End;

end IMSP_CATEGORY_STATISTIC_SYNC;
/

prompt
prompt Creating procedure IMSP_MONITOR_FIRM
prompt ====================================
prompt
CREATE OR REPLACE PROCEDURE IMSP_MONITOR_FIRM AS
    v_errcode number;
    v_errmsg varchar2(1000);
    v_prepare_all NUMBER;
    v_prepare_now NUMBER;
    v_wait_all NUMBER;
    v_wait_now NUMBER;
    v_wait_content_all NUMBER;
    v_wait_content_now NUMBER;
    v_wait_update_all NUMBER;
    v_wait_update_now NUMBER;
    v_fail_all NUMBER;
    v_fail_now NUMBER;
    v_fail_content_all NUMBER;
    v_fail_content_now NUMBER;
    v_fail_update_all NUMBER;
    v_fail_update_now NUMBER;
    v_fail_delete_all NUMBER;
    v_fail_delete_now NUMBER;
    v_dispatch_fail NUMBER;
    v_dispatch_success NUMBER;

BEGIN
  for station in (select * from imsp_station where status != -1)
  loop
      select count(*) into v_prepare_all from imsp_dispatch_task where status = 1 and station_id = station.id and update_time>sysdate-7;
      select count(*) into v_prepare_now from imsp_dispatch_task where status = 1 and station_id = station.id and update_time>sysdate-1;
      select count(*) into v_wait_all from imsp_dispatch_task where status = 2 and station_id = station.id and update_time>sysdate-7;
      select count(*) into v_wait_now from imsp_dispatch_task where status = 2 and station_id = station.id and update_time>sysdate-1;
      select count(*) into v_wait_content_all from imsp_dispatch_task where obj_action = 'CONTENT_TRANSFER' and status = 2 and station_id = station.id and update_time>sysdate-7;
      select count(*) into v_wait_content_now from imsp_dispatch_task where obj_action = 'CONTENT_TRANSFER' and status = 2 and station_id = station.id and update_time>sysdate-1;
      select count(*) into v_wait_update_all from imsp_dispatch_task where obj_action = 'CONTENT_UPDATE' and status = 2 and station_id = station.id and update_time>sysdate-7;
      select count(*) into v_wait_update_now from imsp_dispatch_task where obj_action = 'CONTENT_UPDATE' and status = 2 and station_id = station.id and update_time>sysdate-1;
      select count(*) into v_fail_all from imsp_dispatch_task where status = 4 and station_id = station.id and update_time>sysdate-7;
      select count(*) into v_fail_now from imsp_dispatch_task where status = 4 and station_id = station.id and update_time>sysdate-1;
      select count(*) into v_fail_content_all from imsp_dispatch_task where obj_action = 'CONTENT_TRANSFER' and status = 4 and station_id = station.id and update_time>sysdate-7;
      select count(*) into v_fail_content_now from imsp_dispatch_task where obj_action = 'CONTENT_TRANSFER' and status = 4 and station_id = station.id and update_time>sysdate-1;
      select count(*) into v_fail_update_all from imsp_dispatch_task where obj_action = 'CONTENT_UPDATE' and status = 4 and station_id = station.id and update_time>sysdate-7;
      select count(*) into v_fail_update_now from imsp_dispatch_task where obj_action = 'CONTENT_UPDATE' and status = 4 and station_id = station.id and update_time>sysdate-1;
      select count(*) into v_fail_delete_all from imsp_dispatch_task where obj_action = 'DELETE' and status = 4 and station_id = station.id and update_time>sysdate-7;
      select count(*) into v_fail_delete_now from imsp_dispatch_task where obj_action = 'DELETE' and status = 4 and station_id = station.id and update_time>sysdate-1;

      delete from imsp_command_content where station_name = station.name;
      commit;

      insert into imsp_command_content (ID,STATION_NAME,PREPARE_ALL,PREPARE_NOW,WAIT_ALL,WAIT_NOW,WAIT_CONTENT_ALL,WAIT_CONTENT_NOW, WAIT_UPDATE_ALL,WAIT_UPDATE_NOW, FAIL_ALL,FAIL_NOW,FAIL_CONTENT_ALL,FAIL_CONTENT_NOW,FAIL_UPDATE_ALL,FAIL_UPDATE_NOW,FAIL_DELETE_ALL,FAIL_DELETE_NOW)
      values(imsp_command_content_seq.nextval,station.name,v_prepare_all, v_prepare_now, v_wait_all, v_wait_now, v_wait_content_all, v_wait_content_now, v_wait_update_all, v_wait_update_now, v_fail_all, v_fail_now, v_fail_content_all, v_fail_content_now, v_fail_update_all, v_fail_update_now, v_fail_delete_all, v_fail_delete_now);
      commit;

      delete from imsp_command_schedule where station_name = station.name;
      commit;

      select count(*) into v_dispatch_success from imsp_dispatch_task where obj_class = 'bestv.imsp.entity.content.Schedule' and obj_action = 'REGIST' and status = 3 and station_id = station.id and update_time >= sysdate-1;
      select count(*) into v_dispatch_fail from imsp_dispatch_task where obj_class = 'bestv.imsp.entity.content.Schedule' and obj_action = 'REGIST' and status = 4 and station_id = station.id and update_time >= sysdate-1;
      insert into imsp_command_schedule (ID,STATION_NAME,TIME, dispatch_success, dispatch_fail) values (imsp_command_schedule_seq.nextval,station.name,sysdate,v_dispatch_success,v_dispatch_fail);
      select count(*) into v_dispatch_success from imsp_dispatch_task where obj_class = 'bestv.imsp.entity.content.Schedule' and obj_action = 'REGIST' and status = 3 and station_id = station.id and update_time >= sysdate-2 and update_time <sysdate-1;
      select count(*) into v_dispatch_fail from imsp_dispatch_task where obj_class = 'bestv.imsp.entity.content.Schedule' and obj_action = 'REGIST' and status = 4 and station_id = station.id and update_time >= sysdate-2 and update_time <sysdate-1;
      insert into imsp_command_schedule (ID,STATION_NAME,TIME, dispatch_success, dispatch_fail) values (imsp_command_schedule_seq.nextval,station.name,sysdate-1,v_dispatch_success,v_dispatch_fail);
      select count(*) into v_dispatch_success from imsp_dispatch_task where obj_class = 'bestv.imsp.entity.content.Schedule' and obj_action = 'REGIST' and status = 3 and station_id = station.id and update_time >= sysdate-3 and update_time <sysdate-2;
      select count(*) into v_dispatch_fail from imsp_dispatch_task where obj_class = 'bestv.imsp.entity.content.Schedule' and obj_action = 'REGIST' and status = 4 and station_id = station.id and update_time >= sysdate-3 and update_time <sysdate-2;
      insert into imsp_command_schedule (ID,STATION_NAME,TIME, dispatch_success, dispatch_fail) values (imsp_command_schedule_seq.nextval,station.name,sysdate-2,v_dispatch_success,v_dispatch_fail);
      select count(*) into v_dispatch_success from imsp_dispatch_task where obj_class = 'bestv.imsp.entity.content.Schedule' and obj_action = 'REGIST' and status = 3 and station_id = station.id and update_time >= sysdate-4 and update_time <sysdate-3;
      select count(*) into v_dispatch_fail from imsp_dispatch_task where obj_class = 'bestv.imsp.entity.content.Schedule' and obj_action = 'REGIST' and status = 4 and station_id = station.id and update_time >= sysdate-4 and update_time <sysdate-3;
      insert into imsp_command_schedule (ID,STATION_NAME,TIME, dispatch_success, dispatch_fail) values (imsp_command_schedule_seq.nextval,station.name,sysdate-3,v_dispatch_success,v_dispatch_fail);
      select count(*) into v_dispatch_success from imsp_dispatch_task where obj_class = 'bestv.imsp.entity.content.Schedule' and obj_action = 'REGIST' and status = 3 and station_id = station.id and update_time >= sysdate-5 and update_time <sysdate-4;
      select count(*) into v_dispatch_fail from imsp_dispatch_task where obj_class = 'bestv.imsp.entity.content.Schedule' and obj_action = 'REGIST' and status = 4 and station_id = station.id and update_time >= sysdate-5 and update_time <sysdate-4;
      insert into imsp_command_schedule (ID,STATION_NAME,TIME, dispatch_success, dispatch_fail) values (imsp_command_schedule_seq.nextval,station.name,sysdate-4,v_dispatch_success,v_dispatch_fail);
      select count(*) into v_dispatch_success from imsp_dispatch_task where obj_class = 'bestv.imsp.entity.content.Schedule' and obj_action = 'REGIST' and status = 3 and station_id = station.id and update_time >= sysdate-6 and update_time <sysdate-5;
      select count(*) into v_dispatch_fail from imsp_dispatch_task where obj_class = 'bestv.imsp.entity.content.Schedule' and obj_action = 'REGIST' and status = 4 and station_id = station.id and update_time >= sysdate-6 and update_time <sysdate-5;
      insert into imsp_command_schedule (ID,STATION_NAME,TIME, dispatch_success, dispatch_fail) values (imsp_command_schedule_seq.nextval,station.name,sysdate-5,v_dispatch_success,v_dispatch_fail);
      select count(*) into v_dispatch_success from imsp_dispatch_task where obj_class = 'bestv.imsp.entity.content.Schedule' and obj_action = 'REGIST' and status = 3 and station_id = station.id and update_time >= sysdate-7 and update_time <sysdate-6;
      select count(*) into v_dispatch_fail from imsp_dispatch_task where obj_class = 'bestv.imsp.entity.content.Schedule' and obj_action = 'REGIST' and status = 4 and station_id = station.id and update_time >= sysdate-7 and update_time <sysdate-6;
      insert into imsp_command_schedule (ID,STATION_NAME,TIME, dispatch_success, dispatch_fail) values (imsp_command_schedule_seq.nextval,station.name,sysdate-6,v_dispatch_success,v_dispatch_fail);

      commit;

      delete from imsp_command_position where station_name = station.name;
      commit;

      select count(*) into v_dispatch_fail from imsp_dispatch_busi_cmd where obj_class = 'bestv.imsp.entity.display.Position' and status = 4 and station_id = station.id and end_time >= sysdate-1;
      insert into imsp_command_position (ID,STATION_NAME,TIME,DISPATCH_FAIL) values (imsp_command_position_seq.nextval,station.name,sysdate,v_dispatch_fail);
      select count(*) into v_dispatch_fail from imsp_dispatch_busi_cmd where obj_class = 'bestv.imsp.entity.display.Position' and status = 4 and station_id = station.id and end_time >= sysdate-2 and end_time < sysdate-1;
      insert into imsp_command_position (ID,STATION_NAME,TIME,DISPATCH_FAIL) values (imsp_command_position_seq.nextval,station.name,sysdate-1,v_dispatch_fail);
      select count(*) into v_dispatch_fail from imsp_dispatch_busi_cmd where obj_class = 'bestv.imsp.entity.display.Position' and status = 4 and station_id = station.id and end_time >= sysdate-3 and end_time < sysdate-2;
      insert into imsp_command_position (ID,STATION_NAME,TIME,DISPATCH_FAIL) values (imsp_command_position_seq.nextval,station.name,sysdate-2,v_dispatch_fail);
      select count(*) into v_dispatch_fail from imsp_dispatch_busi_cmd where obj_class = 'bestv.imsp.entity.display.Position' and status = 4 and station_id = station.id and end_time >= sysdate-4 and end_time < sysdate-3;
      insert into imsp_command_position (ID,STATION_NAME,TIME,DISPATCH_FAIL) values (imsp_command_position_seq.nextval,station.name,sysdate-3,v_dispatch_fail);
      select count(*) into v_dispatch_fail from imsp_dispatch_busi_cmd where obj_class = 'bestv.imsp.entity.display.Position' and status = 4 and station_id = station.id and end_time >= sysdate-5 and end_time < sysdate-4;
      insert into imsp_command_position (ID,STATION_NAME,TIME,DISPATCH_FAIL) values (imsp_command_position_seq.nextval,station.name,sysdate-4,v_dispatch_fail);
      select count(*) into v_dispatch_fail from imsp_dispatch_busi_cmd where obj_class = 'bestv.imsp.entity.display.Position' and status = 4 and station_id = station.id and end_time >= sysdate-6 and end_time < sysdate-5;
      insert into imsp_command_position (ID,STATION_NAME,TIME,DISPATCH_FAIL) values (imsp_command_position_seq.nextval,station.name,sysdate-5,v_dispatch_fail);
      select count(*) into v_dispatch_fail from imsp_dispatch_busi_cmd where obj_class = 'bestv.imsp.entity.display.Position' and status = 4 and station_id = station.id and end_time >= sysdate-7 and end_time < sysdate-6;
      insert into imsp_command_position (ID,STATION_NAME,TIME,DISPATCH_FAIL) values (imsp_command_position_seq.nextval,station.name,sysdate-6,v_dispatch_fail);

      commit;

  end loop;

  Exception
      when others Then
      Begin
            v_errcode  :=   sqlcode;
            v_errmsg   :=   substr(sqlerrm,1,100);
          dbms_output.put_line('excute IMSP_MONITOR_FIRM procedure failed,error code:' || v_errcode || ',error message:' || v_errmsg);
          Rollback;
      End;
END IMSP_MONITOR_FIRM;
/

spool off
